set RelWithDebInfo as default build type
authorTaylor Richards <taylor@icculus.org>
Fri, 8 Dec 2017 05:57:15 +0000 (00:57 -0500)
committerTaylor Richards <taylor@icculus.org>
Sat, 17 Mar 2018 15:23:54 +0000 (11:23 -0400)
CMakeLists.txt

index ad9ae6e..cb0effe 100644 (file)
@@ -54,13 +54,15 @@ if(NOT WIN32)
   set(PLATFORM_LIBRARIES "")
 
   add_definitions(-DPLAT_UNIX)
-
-  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 -O2 -DRELEASE_REAL")
-  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2 -DRELEASE_REAL")
+  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 -g -O2")
+  set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -DNDEBUG -Os")
+  set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -DNDEBUG -O2")
   set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g3")
 else()
   set(SDL2DIR "${CMAKE_SOURCE_DIR}/../Support/SDL2" CACHE PATH "Path to SDL2")
@@ -76,15 +78,10 @@ else()
   )
 
   add_definitions(/D _CRT_SECURE_NO_WARNINGS)
-
-  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")
+  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, ...
 endif()
 
 set(BIN_SUFFIX "")