diff options
-rw-r--r-- | CMakeLists.txt | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index a3a0b2b..c18a0e9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,13 +5,17 @@ PROJECT(pvs2) CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR) +SET(EXTRA_C_FLAGS "" CACHE STRING "Additional options to pass to C compiler") +SET(EXTRA_CXX_FLAGS "" CACHE STRING "Additional options to pass to C++ compiler") # set compiler optimizations for debug and release SET(CMAKE_C_FLAGS_DEBUG "-O0 -g -Wall -Wunused -Wunreachable-code -pedantic") SET(CMAKE_C_FLAGS_RELEASE "-O2") SET(CMAKE_CXX_FLAGS_DEBUG "-O0 -g -Wall -Wextra -Wpedantic -std=c++0x -Wcast-align -Wcast-qual -Wchar-subscripts -Wcomment -Wconversion -Wdisabled-optimization -Wfloat-equal -Wformat -Wformat=2 -Wformat-nonliteral -Wformat-security -Wformat-y2k -Wimport -Winit-self -Winline -Winvalid-pch -Wunsafe-loop-optimizations -Wlong-long -Wmissing-braces -Wmissing-field-initializers -Wmissing-format-attribute -Wmissing-include-dirs -Wmissing-noreturn -Wpacked -Wparentheses -Wpointer-arith -Wredundant-decls -Wreturn-type -Wsequence-point -Wsign-compare -Wstack-protector -Wstrict-aliasing -Wstrict-aliasing=2 -Wswitch -Wswitch-default -Wswitch-enum -Wtrigraphs -Wuninitialized -Wunknown-pragmas -Wunreachable-code -Wunused -Wunused-function -Wunused-label -Wunused-parameter -Wunused-value -Wunused-variable -Wvariadic-macros -Wvolatile-register-var -Wwrite-strings") +SET(CMAKE_CXX_FLAGS_RELEASE "-O2") # -Wshadow spams too much :/ SET(CMAKE_CXX_STANDARD 11) -SET(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -std=c++11) +SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c11 ${EXTRA_C_FLAGS}") +SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${EXTRA_CXX_FLAGS}") # local cmake modules SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake) |