update build flags post-rebase
authorTaylor Richards <taylor@icculus.org>
Sat, 17 Mar 2018 15:38:21 +0000 (11:38 -0400)
committerTaylor Richards <taylor@icculus.org>
Sat, 17 Mar 2018 15:38:21 +0000 (11:38 -0400)
CMakeLists.txt

index 45c481a..0e89939 100644 (file)
@@ -67,14 +67,13 @@ if(NOT WIN32)
   set(PLATFORM_LIBRARIES "")
 
   add_definitions(-DPLAT_UNIX)
-  add_definitions(-Wall)
-  add_definitions(-Wshadow)
-# add_definitions(-Wno-format-y2k)
-# add_definitions(-Wno-deprecated)
-  add_definitions(-fsigned-char)
-
-  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -DNDEBUG -DRELEASE_REAL -g -O3")
-  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -DRELEASE_REAL -O3")
+
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshadow")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsigned-char")
+
+  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -O3 -DRELEASE_REAL")
+  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DRELEASE_REAL")
   set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3")
 else()
   set(SDL2DIR "${CMAKE_SOURCE_DIR}/../Support/SDL2" CACHE PATH "Path to SDL2")
@@ -90,10 +89,15 @@ else()
   )
 
   add_definitions(/D _CRT_SECURE_NO_WARNINGS)
-  add_definitions(/W4)
-  add_definitions(/wd4100) # unreferenced parameter
-  add_definitions(/wd4127) # conditional expression is constant: do { } while (0)
-  add_definitions(/wd4996) # deprecated functions: fopen, fileno, ...
+
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4")
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4100") # unreferenced parameter
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4127") # conditional expression is constant: do { } while (0)
+  set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /wd4996") # deprecated functions: fopen, fileno, ...
+
+  set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /MT /D RELEASE_REAL")
+  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT /D RELEASE_REAL")
+  set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
 endif()
 
 set(BIN_SUFFIX "")