cmake: support MSVC_RUNTIME_LIBRARY property#8851
Merged
Merged
Conversation
Contributor
Author
|
CC: @haberman |
haberman
reviewed
Jul 31, 2021
When using a new enough CMake (3.15+) prefer to use the `MSVC_RUNTIME_LIBRARY` property on targets to select the runtime library variant. This property is automatically set to the value specified by `CMAKE_MSVC_RUNTIME_LIBRARY`. This property requires that the CMake Policy 91 is set to new (see CMP0091).
77f5402 to
c47adad
Compare
Contributor
Author
|
Anything else left before we could merge this @haberman? |
Contributor
|
This PR seems to be breaking gRPC build in a test job that tried to continuously test against protobuf's head. internal b/198323179 Looks like this change might be broken? Should we revert? |
Contributor
Author
|
I don't think that this change is broken. The problem is likely the CMake version that is being used to build. |
|
If I understand correctly, when protobuf_BUILD_SHARED_LIBS is OFF and the latest cmake is in-use, this change will force users using static CRT? Previously at least they have a protobuf_MSVC_STATIC_RUNTIME for us to choose. The line shouldn't exist at all. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When using a new enough CMake (3.15+) prefer to use the
MSVC_RUNTIME_LIBRARYproperty on targets to select the runtimelibrary variant. This property is automatically set to the value
specified by
CMAKE_MSVC_RUNTIME_LIBRARY. This proper requires thatthe CMake Policy 91 is set to new (see CMP0091).