1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2024-11-14 11:47:15 +01:00
SqMod/module/Vendor/CPR/cmake/gcc_analyze.cmake
2021-01-27 07:27:48 +02:00

13 lines
489 B
CMake

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()