Skip to content
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

Upgrade to CMake 3.26 #103088

Closed
wants to merge 7 commits into from
Closed

Upgrade to CMake 3.26 #103088

wants to merge 7 commits into from

Conversation

jkoritzinsky
Copy link
Member

Now that we've updated our docker images, we can update our CMake minimum version and get some additional cleanup due to newer CMake features.

I selected CMake 3.26 based on the following versions included in various distributions:

  • Azure Linux 3.0 (CBL-Mariner vNext): 3.28.2
  • Alpine Linux master (the only branch that includes .NET 8 today): 3.28.3
  • RHEL8/Fedora 38: 3.26
  • Ubuntu 24.04 (the distro that Canonical will build .NET 9 for, or newer): 3.28.3

We don't want to break our source-build partners, so we are limited by the oldest version included in a source-building distro. In our case, RHEL is our limiting factor at 3.26.

This PR also adopts various CMake features that were introduced since CMake 3.20 to help improve our build infrastructure:

  • Use the new property-based abstraction for debug info where possible.
  • Use CMake's support for the Microsoft armasm and armasm64 compilers so we can remove all of our logic around faking the armasm and armasm64 support (and separately pre-compiling the arm64 assembly files only when using the VS generators).
  • Use cmake_host_system_information to query distro identity instead of us doing it manually.
  • Use new linking features in CMake to replace our manual, order-dependent, target-specific link flags for link groups and whole-archive linking.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebug "")
set(CMAKE_ASM_COMPILE_OPTIONS_MSVC_RUNTIME_LIBRARY_MultiThreadedDebugDLL "")
set(CMAKE_ASM_COMPILE_OBJECT "<CMAKE_ASM_COMPILER> -g <INCLUDES> <FLAGS> -o <OBJECT> <SOURCE>")
if(CLR_CMAKE_HOST_ARCH_ARM OR CLR_CMAKE_HOST_ARCH_ARM64)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: we have removed support for Windows ARM32

Co-authored-by: Alexander Köplinger <[email protected]>
…s from the RESCAN and WHOLE_ARCHIVE lists as they don't apply.
Copy link
Contributor

Draft Pull Request was automatically closed for 30 days of inactivity. Please let us know if you'd like to reopen it.

@jkoritzinsky
Copy link
Member Author

I'll come back to this after the 9.0 snap. It doesn't need to be done now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants