1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-08 16:57:16 +01:00
SqMod/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()