]> granicus.if.org Git - curl/commitdiff
CMake: fix CURL_WERROR for MSVC
authorMarcel Raad <Marcel.Raad@teamviewer.com>
Tue, 18 Jul 2017 16:31:41 +0000 (18:31 +0200)
committerMarcel Raad <Marcel.Raad@teamviewer.com>
Fri, 4 Aug 2017 10:01:24 +0000 (12:01 +0200)
When using CURL_WERROR in MSVC builds, the debug flags were overridden
by the release flags and /WX got added twice in debug mode.

Closes https://github.com/curl/curl/pull/1715

CMakeLists.txt

index 171941128f7fa61b6d67eb6105d85268ed5f2ff5..0caf3dc1d52afcb07ed02ab0a307491c65909d86 100644 (file)
@@ -246,7 +246,7 @@ endif(BORLAND)
 if(CURL_WERROR)
   if(MSVC_VERSION)
     set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /WX")
-    set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_RELEASE} /WX")
+    set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /WX")
   else()
     # this assumes clang or gcc style options
     set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror")