From 48fff012d04ac95a75a5033124ef0edc5232c359 Mon Sep 17 00:00:00 2001 From: Andrey Astafyev Date: Sat, 18 Apr 2020 20:05:29 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9F=D0=BE=D0=B4=D0=BA=D0=BB=D1=8E=D1=87?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=BD=D0=BE=D0=B9=20=D0=B2=20GCC=2010=20=D0=BE?= =?UTF-8?q?=D0=BF=D1=86=D0=B8=D0=B8=20-fanalyzer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CMLibCompilerFlags.cmake | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CMLibCompilerFlags.cmake b/CMLibCompilerFlags.cmake index 2868e39..ebacc04 100644 --- a/CMLibCompilerFlags.cmake +++ b/CMLibCompilerFlags.cmake @@ -113,6 +113,16 @@ if(CMAKE_CXX_COMPILER_IS_GCC) # Let's just disable the warning for now. check_enable_cxx_flag(-Wno-attributes) endif() + + set(CMAKE_REQUIRED_QUIET TRUE) + check_cxx_compiler_flag(-fanalyzer ANALYZER_GCC_FLAG) + unset(CMAKE_REQUIRED_QUIET) + if(ANALYZER_GCC_FLAG) + option(CMLIB_ENABLE_GCC_ANALYZER "Enable GCC -fanalyzer option" OFF) + if(CMLIB_ENABLE_GCC_ANALYZER) + add_compile_options("-fanalyzer") + endif() + endif() endif() if(CMAKE_SYSTEM_PROCESSOR STREQUAL "e2k")