From b69898257ac8447cc674fa056a89da537b7e7f09 Mon Sep 17 00:00:00 2001 From: Renz Christian Bagaporo Date: Tue, 27 Aug 2019 15:24:31 +0800 Subject: [PATCH] cmake: make build components available before immediately Previous implementation only builds list of components included in the build during component registration. Since the build components is known as the requirements expansion is ongoing, update the list here instead. --- tools/cmake/build.cmake | 4 ++++ tools/cmake/component.cmake | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/cmake/build.cmake b/tools/cmake/build.cmake index 53684a59d4..01b1883340 100644 --- a/tools/cmake/build.cmake +++ b/tools/cmake/build.cmake @@ -219,6 +219,10 @@ function(__build_expand_requirements component_target) idf_build_get_property(build_component_targets __BUILD_COMPONENT_TARGETS) if(NOT component_target IN_LIST build_component_targets) idf_build_set_property(__BUILD_COMPONENT_TARGETS ${component_target} APPEND) + __component_get_property(component_lib ${component_target} COMPONENT_LIB) + idf_build_set_property(__BUILD_COMPONENTS ${component_lib} APPEND) + __component_get_property(component_alias ${component_target} COMPONENT_ALIAS) + idf_build_set_property(BUILD_COMPONENTS ${component_alias} APPEND) endif() endfunction() diff --git a/tools/cmake/component.cmake b/tools/cmake/component.cmake index 8eb2f3f974..d10ac365b5 100644 --- a/tools/cmake/component.cmake +++ b/tools/cmake/component.cmake @@ -482,10 +482,6 @@ function(idf_component_register) # Set dependencies __component_set_all_dependencies() - # Add the component to built components - idf_build_set_property(__BUILD_COMPONENTS ${component_lib} APPEND) - idf_build_set_property(BUILD_COMPONENTS ${component_alias} APPEND) - # Make the COMPONENT_LIB variable available in the component CMakeLists.txt set(COMPONENT_LIB ${component_lib} PARENT_SCOPE) # COMPONENT_TARGET is deprecated but is made available with same function