From 6afe94efaf3784def61f027ca42733472fb5e0a7 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 15 Jun 2019 16:16:27 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B0=20=D1=81=20=D0=BF=D0=BE=D0=BC=D0=BE=D1=89=D1=8C=D1=8E=20?= =?UTF-8?q?clazy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibClazy.cmake | 17 +++++++++++++++++ CMLibCommon.cmake | 1 + 2 files changed, 18 insertions(+) create mode 100644 CMLibClazy.cmake diff --git a/CMLibClazy.cmake b/CMLibClazy.cmake new file mode 100644 index 0000000..5777a68 --- /dev/null +++ b/CMLibClazy.cmake @@ -0,0 +1,17 @@ +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} + COMMAND ${CLAZY_EXE} -extra-arg="-Wno-unknown-warning-option" -p ${CMAKE_BINARY_DIR} ${_sources}) + add_dependencies(clazy-check ${_target}) + else() + message(WARNING "Clazy is not found") + endif() +endfunction() + diff --git a/CMLibCommon.cmake b/CMLibCommon.cmake index 5590f9c..582f511 100644 --- a/CMLibCommon.cmake +++ b/CMLibCommon.cmake @@ -32,6 +32,7 @@ include(CMLibCommonLibraryTarget) include(CMLibBuildTypes) include(CMLibCodeAnalysisPvsStudio) include(CMLibClangTidy) +include(CMLibClazy) include(cotire) include(CMLibBreathe)