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

Simplify CMake build system now that our minimum is 3.20 #88688

Open
10 of 17 tasks
jkoritzinsky opened this issue Jul 11, 2023 · 1 comment
Open
10 of 17 tasks

Simplify CMake build system now that our minimum is 3.20 #88688

jkoritzinsky opened this issue Jul 11, 2023 · 1 comment

Comments

@jkoritzinsky
Copy link
Member

jkoritzinsky commented Jul 11, 2023

There's a few simplifications we can do now that our minimum CMake version is 3.20 on all platforms:

@ghost
Copy link

ghost commented Jul 11, 2023

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

Issue Details

There's a few simplifications we can do now that our minimum CMake version is 3.20 on all platforms:

  • Remove the _obj suffix on our CMake targets and remove the "interface" targets now that target_link_libraries can link to object libraries.
  • Remove the polyfills used with older CMake versions in functions.cmake
  • Remove the add_linker_flag function and instead use target_link_options
  • Remove our conditional setting of CMake policies for policies that are now always available.
  • Enable CMake policy CMP0117 and update the corresponding compile options throughout the repo.
  • Enable CMake policy CMP0092 and update the corresponding compile options throughout the repo.
  • Use CMake's support to set up IPO optimizations: https://cmake.org/cmake/help/latest/policy/CMP0069.html, https://cmake.org/cmake/help/latest/module/CheckIPOSupported.html#module:CheckIPOSupported
  • Use CMake's support to set up PIE options: https://cmake.org/cmake/help/latest/policy/CMP0083.html, https://cmake.org/cmake/help/latest/module/CheckPIESupported.html#module:CheckPIESupported
  • Use the FindPython3 CMake module instead of the deprecated FindPythonInterp module. The deprecated module is being removed in newer versions of CMake.
  • Remove any CMake version checks that check for versions less than 3.20
  • Use improvements in CMake generator expressions to simplify our CMake generator expressions (there are many cases where we can simplify expressions like $<OR:$<CONFIG:X>,$<CONFIG:Y>>:-flag> to $<CONFIG:X,Y>)
  • Investigate if we can simplify the build configuration for Apple Silicon using CMake's support that was added in CMake 3.19
  • Set CMP0112 to the NEW behavior and fix any target dependency issues.
  • Add CMake presets for common build command line settings (like our standard Debug/Checked/Release options) to help enable better IDE integration and simplify our build process a little. (We can only use features available in version 1 or 2 of the presets format).
  • Use CMake's improved support for cross-compiling to Android to simplify our Android and Linux-Bionic build processes.
  • Use the CMAKE_<LANG>_BYTE_ORDER setting instead of manually detecting endianness or using the TestBigEndian module (currently used by Mono)
  • Use the -S and -B options on the CMake command line to specify source and build directories instead of using pushd to be in specific working directories.
Author: jkoritzinsky
Assignees: -
Labels:

area-Infrastructure

Milestone: Future

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: No status
Development

No branches or pull requests

2 participants