-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Update GTest to 1.12.1 #2422
Merged
Merged
Update GTest to 1.12.1 #2422
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't this already default NEW since CMake 3.9?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is, however after reading your comment and scratching my head, I realised there's a subtle difference between
cmake_policy(SET CMP0069 NEW)
andset(CMAKE_POLICY_DEFAULT_CMP0069 NEW)
My understanding (which could well be incorrect) is that we need the latter here because we're propagating this policy to the gtest source, and this is the way to do that - see the last point here:
"Projects may set this variable before a call to add_subdirectory() that adds a third-party project in order to set its policies without modifying third-party code." - which whilst we don't call
add_subdirectory
explicitly, I'm assuming is whatFetchContent
does under the hoodBuilding it on windows 10 msvc seems to back this up. Omitting this line, using
cmake_policy
calls, setting the version in cmake_minimum_required to3.15...3.24
(or basically any versions you like) all do nothing. The only thing that stops the spam - that I know of - is this line.If there's a better way, happy to change to that instead
I suppose this line could be moved lower/closer to just above the gtest call though to reduce its scope (not that its a big deal since we're using the NEW behaviour anyway)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK this is a nice technique when having to use older 3rd party CMake subprojects.