From 22503541b1665e1f2b7d2a849e67da260e8f33be Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Thu, 13 Dec 2018 11:06:57 +0100 Subject: [PATCH] disable clang tidy by default during build --- CMakeLists.txt | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 85e9d96ec..9702844ed 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,6 +77,7 @@ option(BUILD_STATIC "Attempt to statically link external deps" OFF) option(RPATH "Enable RPATH" OFF) option(ENABLE_ASAN "Enable gcc/clang address sanitizer" OFF) option(ENABLE_MSAN "Enable clang memory sanitizer" OFF) +option(ENABLE_TIDY "Enable clang tidy" OFF) option(USE_LTE_RATES "Use standard LTE sampling rates" OFF) @@ -362,18 +363,19 @@ message(STATUS "CMAKE_CXX_FLAGS is ${CMAKE_CXX_FLAGS}") ######################################################################## # clang-tidy check ######################################################################## -find_program( - CLANG_TIDY_BIN - NAMES "clang-tidy" - DOC "Path to clang-tidy executable" -) -if(NOT CLANG_TIDY_BIN) - message(STATUS "clang-tidy not found.") -else() - message(STATUS "clang-tidy found: ${CLANG_TIDY_BIN}") - set(DO_CLANG_TIDY "${CLANG_TIDY_BIN}" "-checks=*,-clang-analyzer-alpha.*,-modernize-*,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-bounds-constant-array-index") -endif() - +if(ENABLE_TIDY) + find_program( + CLANG_TIDY_BIN + NAMES "clang-tidy" + DOC "Path to clang-tidy executable" + ) + if(NOT CLANG_TIDY_BIN) + message(STATUS "clang-tidy not found.") + else() + message(STATUS "clang-tidy found: ${CLANG_TIDY_BIN}") + set(DO_CLANG_TIDY "${CLANG_TIDY_BIN}" "-checks=*,-clang-analyzer-alpha.*,-modernize-*,-cppcoreguidelines-pro-type-vararg,-cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-pro-bounds-constant-array-index") + endif() +endif(ENABLE_TIDY) ######################################################################## # Create uninstall targets