summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2018-07-20 18:21:13 +0200
committerSimon Rettberg2018-07-20 18:21:13 +0200
commit1bf6b70176d7041866015e9dad4dbfcffeebb089 (patch)
tree7f88bfa3c88b1dc1e55be049ebea34d3118d9270
parent[server] Resize thumbs server side on mismatch (diff)
downloadpvs2-1bf6b70176d7041866015e9dad4dbfcffeebb089.tar.gz
pvs2-1bf6b70176d7041866015e9dad4dbfcffeebb089.tar.xz
pvs2-1bf6b70176d7041866015e9dad4dbfcffeebb089.zip
CMake: Add config fields for compiler flags
-rw-r--r--CMakeLists.txt6
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)