feat(build): propagate compiler flags from files to toolchain.cmake

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.
This commit is contained in:
Alexey Lapshin
2026-01-30 17:30:49 +07:00
parent 21fa93e55a
commit 1c08b38b27
23 changed files with 421 additions and 282 deletions
-7
View File
@@ -884,13 +884,6 @@ macro(project project_name)
unset(idf_target)
endif()
if(CONFIG_LIBC_PICOLIBC)
idf_build_set_property(C_COMPILE_OPTIONS "-specs=picolibc.specs" APPEND)
idf_build_set_property(CXX_COMPILE_OPTIONS "-specs=picolibcpp.specs" APPEND)
idf_build_set_property(LINK_OPTIONS "-specs=picolibc.specs" APPEND)
endif()
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY
ADDITIONAL_CLEAN_FILES
"${mapfile}" "${project_elf_src}")