From 8d2809a7726e946d0c68462cf3248a82523bcaff Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 18 Apr 2020 19:36:28 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BE=20=D1=80=D0=B0=D0=B7=D1=80=D0=B5=D1=88=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=B0=D0=B2=D1=82=D0=BE=D0=BC=D0=B0=D1=82?= =?UTF-8?q?=D0=B8=D1=87=D0=B5=D1=81=D0=BA=D0=BE=D0=B3=D0=BE=20=D0=B8=D1=81?= =?UTF-8?q?=D0=BF=D1=80=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BE?= =?UTF-8?q?=D1=88=D0=B8=D0=B1=D0=BE=D0=BA=20=D0=B4=D0=BB=D1=8F=20Clazy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibCodeAnalysisClazy.cmake | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/CMLibCodeAnalysisClazy.cmake b/CMLibCodeAnalysisClazy.cmake index 64abdce..d685967 100644 --- a/CMLibCodeAnalysisClazy.cmake +++ b/CMLibCodeAnalysisClazy.cmake @@ -1,23 +1,21 @@ -set(clazy_checks - container-inside-loop,heap-allocated-small-trivial-type,inefficient-qlist,isempty-vs-count,qt-keywords,unneeded-cast -) - function(add_clazy_check target) - set(_sources ${ARGN}) - find_program(CLAZY_EXE NAMES clazy-standalone) + set(_sources ${ARGN}) + set(_clazy_checks + "container-inside-loop,heap-allocated-small-trivial-type,inefficient-qlist,isempty-vs-count,qt-keywords,unneeded-cast") + set(_args -checks=level2,${_clazy_checks} -extra-arg="-Wno-unknown-warning-option") + if(CLAZY_EXE) if(NOT TARGET clazy-check) add_custom_target(clazy-check) endif() add_custom_target( clazy-check-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMAND ${CLAZY_EXE} -checks=level2,${clazy_checks} -extra-arg="-Wno-unknown-warning-option" -p - ${CMAKE_BINARY_DIR} ${_sources}) + COMMAND ${CLAZY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources}) add_dependencies(clazy-check-${target} ${target}) add_dependencies(clazy-check clazy-check-${target}) else() message(STATUS "CMLIB warning:") - message(STATUS " Clazy analyzer is not found") + message(STATUS " Clazy standalone analyzer is not found") endif() endfunction()