2019-06-15 13:16:27 +00:00
|
|
|
function(add_clazy_check)
|
|
|
|
list(GET ARGN 0 _target)
|
|
|
|
set(_sources ${ARGN})
|
|
|
|
list(REMOVE_AT _sources 0)
|
|
|
|
|
|
|
|
find_program(CLAZY_EXE
|
|
|
|
NAMES clazy-standalone)
|
|
|
|
if(CLAZY_EXE)
|
|
|
|
add_custom_target(clazy-check
|
|
|
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
2019-06-15 13:57:20 +00:00
|
|
|
COMMAND ${CLAZY_EXE} -checks=level2 -extra-arg="-Wno-unknown-warning-option" -p ${CMAKE_BINARY_DIR} ${_sources})
|
2019-06-15 13:16:27 +00:00
|
|
|
add_dependencies(clazy-check ${_target})
|
|
|
|
else()
|
|
|
|
message(WARNING "Clazy is not found")
|
|
|
|
endif()
|
|
|
|
endfunction()
|
|
|
|
|