diff --git a/CMakeLists.txt b/CMakeLists.txt index 67abce6..3fcee79 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,6 +5,12 @@ project(erc) include(sources.cmake) +#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --analyze") + +if(CMAKE_C_FLAGS MATCHES "--analyze") + set(CMAKE_C_LINK_EXECUTABLE "echo 'Will not execute binary when running static analysis'") +endif() + if(APPLE) set(sdl_library /Library/Frameworks/SDL2.framework) set(sdl_headers /Library/Frameworks/SDL2.framework/Headers) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index eafc1e4..1508f20 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,6 +4,12 @@ project(erc-test) set(CMAKE_BUILD_TYPE Debug) +#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --analyze") + +if(CMAKE_C_FLAGS MATCHES "--analyze") + set(CMAKE_C_LINK_EXECUTABLE "echo 'Will not execute binary when running static analysis'") +endif() + if(APPLE) set(opengl_library /System/Library/Frameworks/OpenGL.framework) endif()