Set the cmake policy for CMP0066 and CMP0067 #56811
Merged
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.
As per https://cmake.org/cmake/help/v3.21/policy/CMP0066.html and https://cmake.org/cmake/help/v3.21/policy/CMP0067.html, the default policy for these is
OLDmeaning thattry_compilechecks (such as is done forcheck_c_source_compiles) will not respectCMAKE_<LANG>_FLAGS,CMAKE_<LANG>_STANDARD,CMAKE_<LANG>_STANDARD_REQUIRED, andCMAKE_<LANG>_EXTENSIONSvariables.The net effect of this is that certain header or other checks may be misreported between the test and what we ultimately compile our source with and may cause less efficient code or other downstream failures such as #56746.
This resolves #56746 by ensuring that these policies are explicitly set to
NEWso that the cmake tests match our source compilation configuration and are accurate.