Skip to content

Commit

Permalink
Update static analyzer options
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinHelmut committed Feb 28, 2023
1 parent dd4e71b commit 1eb39f1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions cmake/StaticAnalyzers.cmake
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
if (NOT RELEASE)
if (NOT CMAKE_BUILD_TYPE STREQUAL "Release")
find_program(CLANGTIDY clang-tidy)
if (CLANGTIDY)
message(STATUS "Using clang-tidy")
set(CMAKE_CXX_CLANG_TIDY ${CLANGTIDY})
set(CMAKE_CXX_CLANG_TIDY "${CLANGTIDY};-extra-arg=-Wno-unknown-warning-option")
else ()
message(SEND_ERROR "clang-tidy requested but executable not found")
message(WARNING "clang-tidy requested but executable not found")
endif ()

message(STATUS "Using address sanitizer")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -fsanitize=address -g")
if (NOT WIN32)
message(STATUS "Using address sanitizer")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -fsanitize=address -g")
endif ()
endif ()

0 comments on commit 1eb39f1

Please sign in to comment.