From 8e652dd2cb69928ea1596aa3e59845fef6854e2c Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Thu, 25 Apr 2024 05:11:39 +0200 Subject: add a target to build w/ -fanalyzer --- src/CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ca19416..7bd8e78 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -9,6 +9,11 @@ if(COVERAGE) add_link_options(--coverage) endif() +option(STATIC_ANALYZER "Enable static analysis") +if(STATIC_ANALYZER) + add_compile_options(-fanalyzer) +endif() + # Valgrind on Ubuntu Focal doesn't like DWARF version 5 debug info generated # by Clang 14. if("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang") -- cgit v1.2.3