]> granicus.if.org Git - esp-idf/commitdiff
cmake: fix issues with build process
authorRenz Christian Bagaporo <renz@espressif.com>
Sat, 15 Jun 2019 03:26:32 +0000 (11:26 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Thu, 20 Jun 2019 08:02:22 +0000 (16:02 +0800)
Fix issue when COMPONENTS are is not specified for idf_build_process,
no component is included in the build.

tools/cmake/build.cmake

index 84f6f154fc6099ac6b8ffa08e44183427a103938..ff43ba1023e85f9378b11513d0e25fc7d8166e88 100644 (file)
@@ -367,15 +367,20 @@ macro(idf_build_process target)
     __build_check_python()
 
     idf_build_set_property(__COMPONENT_REQUIRES_COMMON ${target} APPEND)
-    __component_get_requirements()
 
     # Perform early expansion of component CMakeLists.txt in CMake scripting mode.
     # It is here we retrieve the public and private requirements of each component.
     # It is also here we add the common component requirements to each component's
     # own requirements.
+    __component_get_requirements()
+
+    idf_build_get_property(component_targets __COMPONENT_TARGETS)
 
     # Finally, do component expansion. In this case it simply means getting a final list
     # of build component targets given the requirements set by each component.
+
+    # Check if we need to trim the components first, and build initial components list
+    # from that.
     if(__COMPONENTS)
         unset(component_targets)
         foreach(component ${__COMPONENTS})
@@ -390,7 +395,7 @@ macro(idf_build_process target)
     foreach(component_target ${component_targets})
         __build_expand_requirements(${component_target})
     endforeach()
-    unset(__COMPONENT_TARGETS_SEEN)
+    idf_build_unset_property(__COMPONENT_TARGETS_SEEN)
 
     # Get a list of common component requirements in component targets form (previously
     # we just have a list of component names)