Skip to content

CMake: fix CURL_WERROR for MSVC - #1715

Closed
MarcelRaad wants to merge 1 commit into
curl:masterfrom
MarcelRaad:cmake_fix_msvc_werror
Closed

MarcelRaad wants to merge 1 commit into
curl:masterfrom
MarcelRaad:cmake_fix_msvc_werror

Conversation

@MarcelRaad

Copy link
Copy Markdown
Member

/WX got added twice to the compiler flags for the release build and not
at all for the debug build. Fix this by using CMAKE_C_FLAGS instead of
CMAKE_C_FLAGS_RELEASE and CMAKE_C_FLAGS_DEBUG.

Split from #1711 because I'm totally confused now.

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 curl#1715
@MarcelRaad
MarcelRaad force-pushed the cmake_fix_msvc_werror branch from 6ea619d to 615cd03 Compare August 3, 2017 08:20
@MarcelRaad

Copy link
Copy Markdown
Member Author

Changed to use CMAKE_C_FLAGS_RELEASE/CMAKE_C_FLAGS_DEBUG again.

@coveralls

Copy link
Copy Markdown

Coverage Status

Coverage decreased (-0.004%) to 75.262% when pulling 615cd03 on MarcelRaad:cmake_fix_msvc_werror into 58752b7 on curl:master.

@curl curl deleted a comment from coveralls Aug 3, 2017
@jay

jay commented Aug 4, 2017

Copy link
Copy Markdown
Member

This looks like it is just correcting a mistake or is there something more to it?

@MarcelRaad

Copy link
Copy Markdown
Member Author

@jay Yes, now this only uses the correct CFLAGS variable in debug mode. Initially, I had changed it to use CMAKE_C_FLAGS in both debug and release mode, but that didn't work as the configure checks treated warnings as errors too and failed.

@jay

jay commented Aug 4, 2017

Copy link
Copy Markdown
Member

ok lgtm then

@MarcelRaad MarcelRaad closed this in 54aef85 Aug 4, 2017
@MarcelRaad

Copy link
Copy Markdown
Member Author

Thanks!

@MarcelRaad
MarcelRaad deleted the cmake_fix_msvc_werror branch August 4, 2017 10:03
@lock lock Bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants