Skip to content

Commit 518c818

Browse files
pdgendtcarlescufi
authored andcommitted
cmake: sca: codechecker: CMake targets instead of commands
Replace CodeChecker post build commands with regular CMake Targets. Signed-off-by: Pieter De Gendt <[email protected]>
1 parent 19a6dd8 commit 518c818

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

cmake/sca/codechecker/sca.cmake

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ add_custom_target(codechecker ALL
6464
${CMAKE_BINARY_DIR}/compile_commands.json
6565
|| ${CMAKE_COMMAND} -E true # allow to continue processing results
6666
DEPENDS ${CMAKE_BINARY_DIR}/compile_commands.json ${output_dir}/codechecker.ready
67-
BYPRODUCTS ${output_dir}/codechecker.plist
6867
VERBATIM
6968
USES_TERMINAL
7069
COMMAND_EXPAND_LISTS
@@ -89,8 +88,7 @@ if(DEFINED CODECHECKER_EXPORT)
8988
foreach(export_item IN LISTS export_list)
9089
message(STATUS "CodeChecker export: ${CMAKE_BINARY_DIR}/codechecker.${export_item}")
9190

92-
add_custom_command(
93-
TARGET codechecker POST_BUILD
91+
add_custom_target(codechecker-report-${export_item} ALL
9492
COMMAND ${CODECHECKER_EXE} parse
9593
${output_dir}/codechecker.plist
9694
--export ${export_item}
@@ -103,11 +101,11 @@ if(DEFINED CODECHECKER_EXPORT)
103101
USES_TERMINAL
104102
COMMAND_EXPAND_LISTS
105103
)
104+
add_dependencies(codechecker-report-${export_item} codechecker)
106105
endforeach()
107106
elseif(NOT CODECHECKER_PARSE_SKIP)
108107
# Output parse results
109-
add_custom_command(
110-
TARGET codechecker POST_BUILD
108+
add_custom_target(codechecker-parse ALL
111109
COMMAND ${CODECHECKER_EXE} parse
112110
${output_dir}/codechecker.plist
113111
${CODECHECKER_CONFIG_FILE}
@@ -117,11 +115,11 @@ elseif(NOT CODECHECKER_PARSE_SKIP)
117115
USES_TERMINAL
118116
COMMAND_EXPAND_LISTS
119117
)
118+
add_dependencies(codechecker-parse codechecker)
120119
endif()
121120

122121
if(DEFINED CODECHECKER_STORE OR DEFINED CODECHECKER_STORE_OPTS)
123-
add_custom_command(
124-
TARGET codechecker POST_BUILD
122+
add_custom_target(codechecker-store ALL
125123
COMMAND ${CODECHECKER_EXE} store
126124
${CODECHECKER_CONFIG_FILE}
127125
${CODECHECKER_STORE_TAG}
@@ -132,4 +130,5 @@ if(DEFINED CODECHECKER_STORE OR DEFINED CODECHECKER_STORE_OPTS)
132130
USES_TERMINAL
133131
COMMAND_EXPAND_LISTS
134132
)
133+
add_dependencies(codechecker-store codechecker)
135134
endif()

0 commit comments

Comments
 (0)