GitHub user andschwa opened a pull request:
https://github.com/apache/zookeeper/pull/335
ZOOKEEPER-2874: Windows Debug builds don't link with `/MTd`
When building in Debug configuration, this logic ensures that `/MTd` is
used instead of just `/MT`, which on Windows means to link to the
multi-threaded (debug) version of the standard library.
When the user does not add `/MT` as a compile option manually, CMake
would otherwise link to the correct one. Because we are overriding it
for threaded compilations, we also must ensure that Debug configurations
are specially handled.
Furthermore, this must be done using a generator expression over
configuration time logic because the Visual Studio CMake generators are
"multi-configuration generators", that is, the configuration is chosen
at build time instead of compile time. The generator expression handles
this scenario, but checking `CMAKE_BUILD_CONFIG` would not.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/andschwa/zookeeper ZOOKEEPER-2874
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/zookeeper/pull/335.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #335
----
commit 554e20e1f63c02e058f05010868c3f6b5a4b1f2c
Author: Andrew Schwartzmeyer <[email protected]>
Date: 2017-08-11T22:03:28Z
ZOOKEEPER-2874: Windows Debug builds don't link with `/MTd`
When building in Debug configuration, this logic ensures that `/MTd` is
used instead of just `/MT`, which on Windows means to link to the
multi-threaded (debug) version of the standard library.
When the user does not add `/MT` as a compile option manually, CMake
would otherwise link to the correct one. Because we are overriding it
for threaded compilations, we also must ensure that Debug configurations
are specially handled.
Furthermore, this must be done using a generator expression over
configuration time logic because the Visual Studio CMake generators are
"multi-configuration generators", that is, the configuration is chosen
at build time instead of compile time. The generator expression handles
this scenario, but checking `CMAKE_BUILD_CONFIG` would not.
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---