]> granicus.if.org Git - esp-idf/commitdiff
cmake: hide internal targets
authorRenz Christian Bagaporo <renz@espressif.com>
Thu, 22 Aug 2019 01:38:33 +0000 (09:38 +0800)
committerRenz Christian Bagaporo <renz@espressif.com>
Thu, 22 Aug 2019 01:39:24 +0000 (09:39 +0800)
Use imported library, which does not create additional rules, but still
allows attaching arbitraty properties instead of custom targets. This
allows the targets to not appear in the target list of IDEs such as
CLion.

tools/cmake/build.cmake
tools/cmake/component.cmake

index 5383581f12e8aa303ce9b538f6108898f4449a24..f8dc4a21a349e312caa06d87a88fd4ca6152c54c 100644 (file)
@@ -129,7 +129,7 @@ endfunction()
 #
 function(__build_init idf_path)
     # Create the build target, to which the ESP-IDF build properties, dependencies are attached to
-    add_custom_target(__idf_build_target)
+    add_library(__idf_build_target STATIC IMPORTED)
 
     set_default(python "python")
 
index 1ec7efcfcac86409cf8fb667f9d7cf95e7b32454..d807e3858792715d0677ea0317b03d8e3d6fa243 100644 (file)
@@ -173,7 +173,7 @@ function(__component_add component_dir prefix)
     # 'override' components added earlier.
     if(NOT component_target IN_LIST component_targets)
         if(NOT TARGET ${component_target})
-            add_custom_target(${component_target} EXCLUDE_FROM_ALL)
+            add_library(${component_target} STATIC IMPORTED)
         endif()
         idf_build_set_property(__COMPONENT_TARGETS ${component_target} APPEND)
     endif()