-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
(chore) set min version of cmake in native CmakeLists.txt to surpass Cmake CMP0000 policy warning #93437
Conversation
…policy CMP0000 of Cmake
Tagging subscribers to this area: @dotnet/area-infrastructure-libraries Issue DetailsThis closes #93436
|
@dotnet-policy-service agree |
cc @jkoritzinsky as you dealt with minimum cmake versions in our repo in the past |
src/native/libs/System.Security.Cryptography.Native/CMakeLists.txt
Outdated
Show resolved
Hide resolved
src/native/libs/System.Security.Cryptography.Native.Android/CMakeLists.txt
Outdated
Show resolved
Hide resolved
src/native/libs/System.Security.Cryptography.Native.Apple/CMakeLists.txt
Outdated
Show resolved
Hide resolved
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.
Thank you
src/native/libs/System.Security.Cryptography.Native/CMakeLists.txt
Outdated
Show resolved
Hide resolved
hange the minimum version to 3.16 to be consistent with other CMake scripts for System.Globalization.Native/CMakeLists.txt Co-authored-by: Jeremy Koritzinsky <[email protected]>
….txt change the minimum version to 3.16 to be consistent with other CMake scripts for System.Globalization.Native/CMakeLists.txt Co-authored-by: Jeremy Koritzinsky <[email protected]>
@@ -1,3 +1,6 @@ | |||
# Required for StaticICULinking | |||
cmake_minimum_required(VERSION 3.16...3.20) |
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.
What happens when we have > 3.20 installed? Do we want to restrict on max value or can it just be set to 3.16 minimum?
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.
you are right.
limiting the max version is probably not what we want to do.
we can set cmake_minimum_required(VERSION 3.16)
fixed in the latest commit
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.
This is not setting a max version. This is setting the version of CMake to set the policy values for. Setting it to 3.20 ensures that for the dotnet/runtime build, we use a consistent set of CMake policy configurations.
How did you come up with 3.16? It would be better for this version to match the min cmake version used in the rest of the repo. |
@jkotas, please expand the comments to see the history. It was a comment from @jkoritzinsky to use the version range 3.16...3.20, on which I commented that maybe we don't need to restrict to the max value. I think some old distros are providing older versions, so it makes sense to lower the requirements of "shipping" cmake script, which are not using any new feature. |
3.16 is the minimum required version for the CMake scripts we use to build Apple and Android apps on customer machines (see the CMake templates in AppleAppBuilder and AndroidAppBuilder). |
@jkotas |
I do not see a strong reason for keeping the Apple/Android builder min cmake version to be in sync with min cmake version for this Linux-specific opt-in option. I see the following options:
|
We don't have any restriction on > 3.20 version. In fact, the minimum version is 3.20. runtime/src/coreclr/CMakeLists.txt Line 1 in 765798c
|
One aspect of setting the minimum required as 3.20 in that was is to set the CMake policy defaults to the 3.20 rules, no matter the version of CMake that’s actually running the build. Using the |
so |
This closes #93436
Setting the min version for
cmake
reflectinghttps://github.com/dotnet/runtime/blob/main/src/native/libs/CMakeLists.txt