1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-14 19:57:17 +01:00
SqMod/module/Vendor/CPR/cmake/gcc_analyze.cmake

13 lines
489 B
CMake
Raw Normal View History

include(CheckCXXCompilerFlag)
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
check_cxx_compiler_flag("-fanalyzer" HAS_GCC_STATIC_ANALYZER)
if(HAS_GCC_STATIC_ANALYZER AND NOT ENABLE_LINTING)
option(ENABLE_GCC_STATIC_ANALYZER "Enable linting with the GCC static analyzer" OFF)
if(ENABLE_GCC_STATIC_ANALYZER)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fanalyzer")
set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -fanalyzer")
endif()
endif()
endif()