From a486bc85580dd00dc027eb1ddeb3731dcc274952 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Fri, 19 Mar 2021 17:23:04 +0300 Subject: [PATCH] Clang-tidy requires assertions --- cmake/analysis.cmake | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmake/analysis.cmake b/cmake/analysis.cmake index 369be295746..267bb34248b 100644 --- a/cmake/analysis.cmake +++ b/cmake/analysis.cmake @@ -16,6 +16,10 @@ if (ENABLE_CLANG_TIDY) set (USE_CLANG_TIDY ON) + # clang-tidy requires assertions to guide the analysis + # Note that NDEBUG is set implicitly by CMake for non-debug builds + set(COMPILER_FLAGS "${COMPILER_FLAGS} -UNDEBUG") + # The variable CMAKE_CXX_CLANG_TIDY will be set inside src and base directories with non third-party code. # set (CMAKE_CXX_CLANG_TIDY "${CLANG_TIDY_PATH}") elseif (FAIL_ON_UNSUPPORTED_OPTIONS_COMBINATION)