cmake: move specs compiler and linker flags to toolchain properties
Moving specs argument to compiler and linker properties so that the compiler and linker in use can decide how the flags are mapped / handled for the compiler and linker in use. This avoids specifying `--specs=spec.picolibc` for clang which prints a warning about an unused argument. Signed-off-by: Torsten Rasmussen <Torsten.Rasmussen@nordicsemi.no>
This commit is contained in:
parent
102b3fc078
commit
9d835fe464
|
@ -125,3 +125,5 @@ set_compiler_property(PROPERTY warning_error_coding_guideline
|
|||
)
|
||||
|
||||
set_compiler_property(PROPERTY no_global_merge "-mno-global-merge")
|
||||
|
||||
set_compiler_property(PROPERTY specs)
|
||||
|
|
|
@ -139,3 +139,7 @@ set_compiler_property(PROPERTY warning_shadow_variables)
|
|||
# Compiler flags to avoid recognizing built-in functions
|
||||
set_compiler_property(PROPERTY no_builtin)
|
||||
set_compiler_property(PROPERTY no_builtin_malloc)
|
||||
|
||||
# Compiler flag for defining specs. Used only by gcc, other compilers may keep
|
||||
# this undefined.
|
||||
set_compiler_property(PROPERTY specs)
|
||||
|
|
|
@ -241,3 +241,5 @@ set_compiler_property(PROPERTY warning_shadow_variables -Wshadow)
|
|||
|
||||
set_compiler_property(PROPERTY no_builtin -fno-builtin)
|
||||
set_compiler_property(PROPERTY no_builtin_malloc -fno-builtin-malloc)
|
||||
|
||||
set_compiler_property(PROPERTY specs -specs=)
|
||||
|
|
|
@ -15,3 +15,5 @@ add_link_options(-gdwarf-4)
|
|||
|
||||
# Extra warnings options for twister run
|
||||
set_property(TARGET linker PROPERTY warnings_as_errors -Wl,--fatal-warnings)
|
||||
|
||||
set_linker_property(PROPERTY specs -specs=)
|
||||
|
|
|
@ -49,3 +49,7 @@ set_property(TARGET linker PROPERTY no_relax)
|
|||
|
||||
# Linker flag for enabling relaxation of address optimization for jump calls.
|
||||
set_property(TARGET linker PROPERTY relax)
|
||||
|
||||
# Linker flag for defining specs. Defined only by gcc, when gcc is used as
|
||||
# front-end for ld.
|
||||
set_compiler_property(PROPERTY specs)
|
||||
|
|
|
@ -15,9 +15,8 @@ if(NOT CONFIG_PICOLIBC_USE_MODULE)
|
|||
# Use picolibc provided with the toolchain. This requires a new enough
|
||||
# toolchain so that the version of picolibc supports auto-detecting a
|
||||
# Zephyr build (via the __ZEPHYR__ macro) to expose the Zephyr C API
|
||||
|
||||
zephyr_compile_options(--specs=picolibc.specs)
|
||||
zephyr_libc_link_libraries(--specs=picolibc.specs)
|
||||
zephyr_compile_options(PROPERTY specs picolibc.specs)
|
||||
zephyr_link_libraries(PROPERTY specs picolibc.specs)
|
||||
if(CONFIG_PICOLIBC_IO_FLOAT)
|
||||
zephyr_compile_definitions(PICOLIBC_DOUBLE_PRINTF_SCANF)
|
||||
zephyr_link_libraries(-DPICOLIBC_DOUBLE_PRINTF_SCANF)
|
||||
|
|
Loading…
Reference in New Issue