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

Set static/shared msvc runtime flags using a CMake property instead of overwriting the flags #2434

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TinyTinni
Copy link

Issue #, if available: #2056

Description of changes:
This PR changes how the flags for the MSVC C++ runtime linkage are set. Before this PR, the CMAKE_CXX_FLAGS were changed. WIth CMake 3.15, there exists the property CMAKE_MSVC_RUNTIME_LIBRARY. Based on the options provided by this SDK, this property is set instead of changing the flags.

Defining the property so early has 2 advantages:

As you can read in the CMake documentation, any non msvc builds are not affected by defining the property.

The value is ignored on compilers not targeting the MSVC ABI, but an unsupported value will be rejected as an error when using a compiler targeting the MSVC ABI.

Please ask and/or edit, if I missed something.

Check all that applies:

  • Did a review by yourself.
  • Added proper tests to cover this PR. (If tests are not applicable, explain.)
    Changes in the buildsystem. Test would be, if the project compiled or not. I cannot see any CI builds in the .guthub/workflows. If I should add a build target, please let me know.
  • Checked if this PR is a breaking (APIs have been changed) change.
    Requires CMake 3.15 instead of 3.12. CMake 3.15 is from 2019, so I don't see it as a big problem
  • Checked if this PR will not introduce cross-platform inconsistent behavior.
    Only Windows is affected.
  • Checked if this PR would require a ReadMe/Wiki update.
    No Readme changes required. Options are still the same with the same semantic.

Check which platforms you have built SDK on to verify the correctness of this PR.

  • Linux
  • Windows
    Build and unit-tested locally with dynamic and static linkage
  • Android
  • MacOS
  • IOS
  • Other Platforms

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@TinyTinni
Copy link
Author

Hi,
any updates on this? Do you need any more input from me?

@jmklix jmklix added the Cmake Cmake related submissions label Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cmake Cmake related submissions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants