ci: introduce CI_LINT option

This will abort if lint programs are not found, and is meant primarily
for the lint job in CI. Supersedes the REQUIRED argument in
add_glob_target as it's a superior replacement by being a built-in
solution.
This commit is contained in:
dundargoc
2023-06-24 00:29:53 +02:00
committed by GitHub
parent 4dc86477b6
commit 46e95909bf
3 changed files with 10 additions and 14 deletions

View File

@ -4,7 +4,6 @@
# depends on the value of TOUCH_STRATEGY.
#
# Options:
# REQUIRED - Abort if COMMAND doesn't exist.
#
# Single value arguments:
# TARGET - Name of the target
@ -53,7 +52,7 @@
# files.
function(add_glob_target)
cmake_parse_arguments(ARG
"REQUIRED"
""
"TARGET;COMMAND;GLOB_PAT;TOUCH_STRATEGY"
"FLAGS;FILES;GLOB_DIRS;EXCLUDE"
${ARGN}
@ -61,14 +60,8 @@ function(add_glob_target)
if(NOT ARG_COMMAND)
add_custom_target(${ARG_TARGET})
if(ARG_REQUIRED)
add_custom_command(TARGET ${ARG_TARGET}
COMMAND ${CMAKE_COMMAND} -E echo "${ARG_TARGET}: ${ARG_COMMAND} not found"
COMMAND false)
else()
add_custom_command(TARGET ${ARG_TARGET}
COMMAND ${CMAKE_COMMAND} -E echo "${ARG_TARGET} SKIP: ${ARG_COMMAND} not found")
endif()
add_custom_command(TARGET ${ARG_TARGET}
COMMAND ${CMAKE_COMMAND} -E echo "${ARG_TARGET} SKIP: ${ARG_COMMAND} not found")
return()
endif()