Skip to content

Commit 72ddc94

Browse files
committed
cmake: hide internal targets
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.
1 parent 02c7c38 commit 72ddc94

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tools/cmake/build.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ endfunction()
129129
#
130130
function(__build_init idf_path)
131131
# Create the build target, to which the ESP-IDF build properties, dependencies are attached to
132-
add_custom_target(__idf_build_target)
132+
add_library(__idf_build_target STATIC IMPORTED)
133133

134134
set_default(python "python")
135135

tools/cmake/component.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ function(__component_add component_dir prefix)
173173
# 'override' components added earlier.
174174
if(NOT component_target IN_LIST component_targets)
175175
if(NOT TARGET ${component_target})
176-
add_custom_target(${component_target} EXCLUDE_FROM_ALL)
176+
add_library(${component_target} STATIC IMPORTED)
177177
endif()
178178
idf_build_set_property(__COMPONENT_TARGETS ${component_target} APPEND)
179179
endif()

0 commit comments

Comments
 (0)