make newlib the default

This commit is contained in:
Hardy Griech 2025-10-15 20:30:24 +02:00
parent bf670a8a32
commit d13a84ff70

View file

@ -44,8 +44,11 @@ endforeach()
list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES PICO_CLIB)
set(_PICO_CLIB_PATH "${PICO_COMPILER_DIR}/../lib/clang-runtimes/arm-none-eabi")
if(PICO_CLIB STREQUAL "")
# use default from above
if(PICO_CLIB STREQUAL "" OR PICO_CLIB STREQUAL "newlib")
# newlib is 1st class choice
if(EXISTS "${PICO_COMPILER_DIR}/../lib/clang-runtimes/newlib/arm-none-eabi")
set(_PICO_CLIB_PATH "${PICO_COMPILER_DIR}/../lib/clang-runtimes/newlib/arm-none-eabi")
endif()
elseif(PICO_CLIB STREQUAL "llvm_libc")
if(EXISTS "${PICO_COMPILER_DIR}/../lib/clang-runtimes/llvmlibc/arm-none-eabi")
set(_PICO_CLIB_PATH "${PICO_COMPILER_DIR}/../lib/clang-runtimes/llvmlibc/arm-none-eabi")
@ -54,10 +57,6 @@ elseif(PICO_CLIB STREQUAL "picolibc")
if(EXISTS "${PICO_COMPILER_DIR}/../lib/clang-runtimes/picolibc/arm-none-eabi")
set(_PICO_CLIB_PATH "${PICO_COMPILER_DIR}/../lib/clang-runtimes/picolibc/arm-none-eabi")
endif()
elseif(PICO_CLIB STREQUAL "newlib")
if(EXISTS "${PICO_COMPILER_DIR}/../lib/clang-runtimes/newlib/arm-none-eabi")
set(_PICO_CLIB_PATH "${PICO_COMPILER_DIR}/../lib/clang-runtimes/newlib/arm-none-eabi")
endif()
else()
message(FATAL_ERROR "PICO_CLIB must be one of newlib, picolib, llvm_libc or empty (but is '${PICO_CLIB}')")
endif()