use correct compiler flags
authoralfadur
Sun, 14 Oct 2018 21:25:59 +0300
changeset 13930 a44e4c057f57
parent 13929 9a1f1e8170f2
child 13931 6c8d4e140f27
use correct compiler flags
CMakeLists.txt
--- a/CMakeLists.txt	Sun Oct 14 19:04:51 2018 +0200
+++ b/CMakeLists.txt	Sun Oct 14 21:25:59 2018 +0300
@@ -113,20 +113,21 @@
 endif()
 
 #set default compiler flags
-add_flag_append(CMAKE_C_FLAGS "-Wall -pipe")
-add_flag_append(CMAKE_C_FLAGS_RELEASE "-O2")
 if(WIN32 AND VCPKG_TOOLCHAIN)
-    add_flag_append(CMAKE_C_FLAGS_DEBUG "-O0")
+    add_flag_append(CMAKE_C_FLAGS "/DWIN32_VCPKG /Wall")
+    add_flag_append(CMAKE_C_FLAGS_RELEASE "/Ox")
+    add_flag_append(CMAKE_C_FLAGS_DEBUG "/Od")
+    add_flag_append(CMAKE_CXX_FLAGS "/DWIN32_VCPKG /Wall")
+    add_flag_append(CMAKE_CXX_FLAGS_RELEASE "/Ox")
+    add_flag_append(CMAKE_CXX_FLAGS_DEBUG "/Od")    
 else()
+    add_flag_append(CMAKE_C_FLAGS "-Wall -pipe")
+    add_flag_append(CMAKE_C_FLAGS_RELEASE "-O2")
     add_flag_append(CMAKE_C_FLAGS_DEBUG "-Wextra -O0")
-endif()
-add_flag_append(CMAKE_CXX_FLAGS "-Wall -pipe")
-add_flag_append(CMAKE_CXX_FLAGS_RELEASE "-O2")
-if(WIN32 AND VCPKG_TOOLCHAIN)
-    add_flag_append(CMAKE_CXX_FLAGS_DEBUG "-O0")
-else()
-    add_flag_append(CMAKE_CXX_FLAGS_DEBUG "-Wextra -O0")
-endif()
+    add_flag_append(CMAKE_CXX_FLAGS "-Wall -pipe")
+    add_flag_append(CMAKE_CXX_FLAGS_RELEASE "-O2")
+    add_flag_append(CMAKE_CXX_FLAGS_DEBUG "-Wextra -O0")    
+endif()       
 
 #CMake adds a lot of additional configuration flags, so let's clear them up
 if(MINIMAL_FLAGS)