mirror of
https://github.com/espressif/esp-idf.git
synced 2026-04-27 19:13:21 +00:00
feat(cmake): Produce warnings when component dependencies are not defined
There are idf.py hints for helping the user to set component dependencies properly instead of building sources out-of-component or including headers from outside the component directory. These are produced with tools/idf_py_actions/hint_modules/component_requirements.py. However, idf.py hints are printed only when the build fails. If the user starts with a buildable solution then the suggestions to add component dependencies are not printed. This commit introduces cmake-level warnings for building source files from outside the component and including header files without setting up proper component dependencies.
This commit is contained in:
@@ -320,3 +320,12 @@ foreach(component_target ${build_component_targets})
|
||||
endif()
|
||||
set(__idf_component_context 0)
|
||||
endforeach()
|
||||
|
||||
# Run component validation checks after all components have been processed
|
||||
# Only run validation for the main project, not subprojects like bootloader
|
||||
idf_build_get_property(bootloader_build BOOTLOADER_BUILD)
|
||||
idf_build_get_property(esp_tee_build ESP_TEE_BUILD)
|
||||
if(NOT bootloader_build AND NOT esp_tee_build)
|
||||
include("${CMAKE_CURRENT_LIST_DIR}/tools/cmake/component_validation.cmake")
|
||||
__component_validation_run_checks()
|
||||
endif()
|
||||
|
||||
Reference in New Issue
Block a user