From afa8b1e29579ba085f2d5b58116cd1be497c1b5d Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 18 Apr 2020 18:57:42 +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=20Clang-Tid?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibCodeAnalysisClangTidy.cmake | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/CMLibCodeAnalysisClangTidy.cmake b/CMLibCodeAnalysisClangTidy.cmake index 4071b25..8b272bd 100644 --- a/CMLibCodeAnalysisClangTidy.cmake +++ b/CMLibCodeAnalysisClangTidy.cmake @@ -8,22 +8,23 @@ find_program( clang-tidy-6.0 clang-tidy) if(CLANG_TIDY_EXE) - option(CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF) - if(CLANG_TIDY_FIX) - list(APPEND _args "-fix") - endif() + option(CMLIB_CLANG_TIDY_FIX "Perform fixes for Clang-Tidy" OFF) endif() function(add_clang_tidy_check target) set(_sources ${ARGN}) + set(_args -extra-arg="-Wno-unknown-warning-option") if(CLANG_TIDY_EXE) + if(CMLIB_CLANG_TIDY_FIX) + list(APPEND _args "-fix") + endif() if(NOT TARGET clang-tidy-check) add_custom_target(clang-tidy-check) endif() add_custom_target( clang-tidy-check-${target} WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - COMMAND ${CLANG_TIDY_EXE} -extra-arg="-Wno-unknown-warning-option" -p ${CMAKE_BINARY_DIR} ${_sources}) + COMMAND ${CLANG_TIDY_EXE} ${_args} -p ${CMAKE_BINARY_DIR} ${_sources}) add_dependencies(clang-tidy-check-${target} ${target}) add_dependencies(clang-tidy-check clang-tidy-check-${target}) else()