don't use -Wextra when building with vcpkg
authoralfadur
Sun, 14 Oct 2018 20:02:51 +0300 (2018-10-14)
changeset 13911 d4874de4736b
parent 13910 fed924791e06
child 13912 c36aaa30be98
don't use -Wextra when building with vcpkg
CMakeLists.txt
--- a/CMakeLists.txt	Sun Oct 14 19:28:24 2018 +0300
+++ b/CMakeLists.txt	Sun Oct 14 20:02:51 2018 +0300
@@ -115,10 +115,18 @@
 #set default compiler flags
 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")
+if(WIN32 AND VCPKG_TOOLCHAIN)
+    add_flag_append(CMAKE_C_FLAGS_DEBUG "-O0")
+else()
+    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")
-add_flag_append(CMAKE_CXX_FLAGS_DEBUG "-Wextra -O0")
+if(WIN32 AND VCPKG_TOOLCHAIN)
+    add_flag_append(CMAKE_CXX_FLAGS_DEBUG "-O0")
+else()
+    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)