1
0
mirror of https://github.com/pevans/erc-c.git synced 2024-11-27 05:49:24 +00:00

Do static analysis if env variable is set

This commit is contained in:
Peter Evans 2017-12-19 01:02:48 -06:00
parent dfbe0750ae
commit 28cd93d5e9
2 changed files with 6 additions and 2 deletions

View File

@ -5,7 +5,9 @@ project(erc)
include(sources.cmake)
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --analyze")
if(DEFINED ENV{STATIC_ANALYSIS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --analyze")
endif()
if(CMAKE_C_FLAGS MATCHES "--analyze")
set(CMAKE_C_LINK_EXECUTABLE "echo 'Will not execute binary when running static analysis'")

View File

@ -4,7 +4,9 @@ project(erc-test)
set(CMAKE_BUILD_TYPE Debug)
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --analyze")
if(DEFINED ENV{STATIC_ANALYSIS})
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --analyze")
endif()
if(CMAKE_C_FLAGS MATCHES "--analyze")
set(CMAKE_C_LINK_EXECUTABLE "echo 'Will not execute binary when running static analysis'")