mirror of
https://github.com/espressif/esp-idf.git
synced 2025-12-27 05:37:32 +00:00
This change improves build consistency across external projects integrated through CMake by ensuring that compiler flags defined in configuration files are passed correctly to the toolchain. It covers the majority of use cases, as external projects are typically also CMake-based. For projects that use a custom build system, users will still need to specify the required flags manually.
24 lines
841 B
CMake
24 lines
841 B
CMake
if(CONFIG_IDF_TOOLCHAIN_GCC)
|
|
if(CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND)
|
|
idf_toolchain_add_flags(COMPILE_OPTIONS "-mdisable-hardware-atomics")
|
|
else()
|
|
idf_toolchain_remove_flags(COMPILE_OPTIONS "-mdisable-hardware-atomics")
|
|
endif()
|
|
|
|
if(CONFIG_LIBC_PICOLIBC)
|
|
idf_toolchain_add_flags(COMPILE_OPTIONS "-specs=picolibc.specs")
|
|
else()
|
|
idf_toolchain_remove_flags(COMPILE_OPTIONS "-specs=picolibc.specs")
|
|
endif()
|
|
|
|
if(CONFIG_LIBC_NEWLIB_NANO_FORMAT)
|
|
idf_toolchain_add_flags(LINK_OPTIONS "--specs=nano.specs")
|
|
else()
|
|
idf_toolchain_remove_flags(LINK_OPTIONS "--specs=nano.specs")
|
|
endif()
|
|
else() # TODO IDF-14338
|
|
if(CONFIG_STDATOMIC_S32C1I_SPIRAM_WORKAROUND)
|
|
idf_build_set_property(COMPILE_OPTIONS "-mdisable-hardware-atomics" APPEND)
|
|
endif()
|
|
endif()
|