Remove Explicit Deletion of CMake /GR Flag as 3.20's *CMP0117* by Default Doesn't Add It#96814
Remove Explicit Deletion of CMake /GR Flag as 3.20's *CMP0117* by Default Doesn't Add It#96814ivdiazsa merged 5 commits intodotnet:mainfrom ivdiazsa:cmake-0117-gr
/GR Flag as 3.20's *CMP0117* by Default Doesn't Add It#96814Conversation
|
Tagging subscribers to this area: @hoyosjs Issue DetailsCompletes #94354. CMake Version 3.20+ implements a new version of Policy CMP0117. This new version does not add the
|
src/coreclr/CMakeLists.txt
Outdated
| # Set the project name | ||
| project(CoreCLR) | ||
|
|
||
| cmake_policy(SET CMP0117 NEW) |
There was a problem hiding this comment.
Can you compare the generated build.ninja files between builds if we set the policy or just leave it at its default value?
I think they'll be the same (since the policy defaults are set based on the version in the cmake_minimum_required statement.
There was a problem hiding this comment.
The Ninja files were the same, so indeed not specifying = set by default. I've sent a new commit with the change removing it.
explicit setting in CMakeLists.txt
| add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/GS>) # Explicitly enable the buffer security checks | ||
| add_compile_options($<$<COMPILE_LANGUAGE:C,CXX>:/fp:precise>) # Enable precise floating point | ||
|
|
||
| # disable C++ RTTI |
|
Failure is unrelated and is being tracked in issue #97103, so we can merge this now. |
…efault Doesn't Add It (dotnet#96814) * Remove /GR flag as new CMake Policy doesn't add it by default. * Tell CMake to use the new behavior of CMP0117. * CMake policy is by default set when not specified, so removing the explicit setting in CMakeLists.txt * Flag /GR- fix. * Restored accidentally deleted comment.
Completes #94354. CMake Version 3.20+ implements a new version of Policy CMP0117. This new version does not add the
/GRflag by default toCMAKE_CXX_FLAGS. And this is the behavior we want. However, previous versions of CMake did add it, so we had to manually remove it. This PR removes that deletion as part of the efforts to simplify our CMake build in general.