Skip to content

Commit d13a84f

Browse files
committed
make newlib the default
1 parent bf670a8 commit d13a84f

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

cmake/preload/toolchains/util/pico_arm_clang_common.cmake

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,11 @@ endforeach()
4444
list(APPEND CMAKE_TRY_COMPILE_PLATFORM_VARIABLES PICO_CLIB)
4545

4646
set(_PICO_CLIB_PATH "${PICO_COMPILER_DIR}/../lib/clang-runtimes/arm-none-eabi")
47-
if(PICO_CLIB STREQUAL "")
48-
# use default from above
47+
if(PICO_CLIB STREQUAL "" OR PICO_CLIB STREQUAL "newlib")
48+
# newlib is 1st class choice
49+
if(EXISTS "${PICO_COMPILER_DIR}/../lib/clang-runtimes/newlib/arm-none-eabi")
50+
set(_PICO_CLIB_PATH "${PICO_COMPILER_DIR}/../lib/clang-runtimes/newlib/arm-none-eabi")
51+
endif()
4952
elseif(PICO_CLIB STREQUAL "llvm_libc")
5053
if(EXISTS "${PICO_COMPILER_DIR}/../lib/clang-runtimes/llvmlibc/arm-none-eabi")
5154
set(_PICO_CLIB_PATH "${PICO_COMPILER_DIR}/../lib/clang-runtimes/llvmlibc/arm-none-eabi")
@@ -54,10 +57,6 @@ elseif(PICO_CLIB STREQUAL "picolibc")
5457
if(EXISTS "${PICO_COMPILER_DIR}/../lib/clang-runtimes/picolibc/arm-none-eabi")
5558
set(_PICO_CLIB_PATH "${PICO_COMPILER_DIR}/../lib/clang-runtimes/picolibc/arm-none-eabi")
5659
endif()
57-
elseif(PICO_CLIB STREQUAL "newlib")
58-
if(EXISTS "${PICO_COMPILER_DIR}/../lib/clang-runtimes/newlib/arm-none-eabi")
59-
set(_PICO_CLIB_PATH "${PICO_COMPILER_DIR}/../lib/clang-runtimes/newlib/arm-none-eabi")
60-
endif()
6160
else()
6261
message(FATAL_ERROR "PICO_CLIB must be one of newlib, picolib, llvm_libc or empty (but is '${PICO_CLIB}')")
6362
endif()

0 commit comments

Comments
 (0)