1
0
Fork 0
forked from nuttx/nuttx-update

libm: Do not link the toolchain's libm unless explicitly selected

Fix CMake-based build system to include the toolchain's libm only
when `CONFIG_LIBM_TOOLCHAIN` is selected. Before this commit, if
the user selected `CONFIG_LIBM_NEWLIB`, for instance, the build
system would still link the toolchain's libm functions instead of
the ones provided by newlib.
This commit is contained in:
Tiago Medicci Serrano 2024-12-03 12:58:24 -03:00 committed by Xiang Xiao
parent d5fba177b1
commit 80dd961f23
2 changed files with 2 additions and 2 deletions

View file

@ -45,7 +45,7 @@ execute_process(
list(APPEND EXTRA_LIB ${extra_library})
if(NOT CONFIG_LIBM)
if(CONFIG_LIBM_TOOLCHAIN)
execute_process(
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
--print-file-name=libm.a

View file

@ -46,7 +46,7 @@ if(CONFIG_TRICORE_TOOLCHAIN_GNU)
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE extra_library)
list(APPEND EXTRA_LIB ${extra_library})
if(NOT CONFIG_LIBM)
if(CONFIG_LIBM_TOOLCHAIN)
execute_process(
COMMAND ${CMAKE_C_COMPILER} ${CMAKE_C_FLAG_ARGS} ${NUTTX_EXTRA_FLAGS}
--print-file-name=libm.a