Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMakeLists.txt: Enable CMAKE_MSVC_RUNTIME_LIBRARY support (#2652) #43

Merged
merged 1 commit into from
Jun 6, 2024

Conversation

malkia
Copy link
Owner

@malkia malkia commented Jun 6, 2024

The documentation for CMAKE_MSVC_RUNTIME_LIBRARY states 1:

This variable has effect only when policy CMP0091 is set to NEW prior to
the first project() or enable_language() command that enables a language
using a compiler targeting the MSVC ABI.

so the current usage of CMAKE_MSVC_RUNTIME_LIBRARY for vcpkg does not work at all.

Let's fix that by setting policy 91 to new if present.

Fixes # (issue)

Changes

Please provide a brief description of the changes here.

For significant contributions please make sure you have completed the following items:

  • CHANGELOG.md updated for non-trivial changes
  • Unit tests have been added
  • Changes in public API reviewed

The documentation for CMAKE_MSVC_RUNTIME_LIBRARY states [1]:

> This variable has effect only when policy CMP0091 is set to NEW prior to
> the first project() or enable_language() command that enables a language
> using a compiler targeting the MSVC ABI.

so the current usage of CMAKE_MSVC_RUNTIME_LIBRARY for vcpkg does not work
at all.

Let's fix that by setting policy 91 to new if present.

[1]: https://cmake.org/cmake/help/latest/variable/CMAKE_MSVC_RUNTIME_LIBRARY.html

Co-authored-by: Tom Tan <Tom.Tan@microsoft.com>
@malkia malkia merged commit 5f0bd61 into malkia:main Jun 6, 2024
1 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants