Adding Reusable CMake build workflow - #313
Open
etcwilde wants to merge 1 commit into
Open
Conversation
This workflow absorbs the boilerplate in installing and setting CMake builds across macOS, Linux, and Windows. The workflow defaults to using CMake 4.0.3, and has the appropriate hashes for each architecture and platform. If you override the version, you will also need to provide the appropriate hashes for the platforms. Each platform can be optionally enabled or disabled with the `enable_*_checks`. By default, only Linux is tested, but macOS and Windows can both be enabled. Controlling each build is done with three commands for each platform: 1. `*_pre_build_command` 2. `*_configure_command` 3. `*_build_command` The pre-build command runs first, allowing you to install dependencies like Ninja. The `configure` command is used to run CMake to configure the build. By default, this runs the platform-equivalent of `$CMAKE -G Ninja -B build -S .`. The build-command is for running the build. By default, it runs the platform-equivalent of `$CMAKE --build build` Each of these commands has a `CMAKE` and `CTEST` environment variable defined, specifying the path to the installed CMake and CTest binaries. Linux and Windows both run x86_64 and Arm64, while macOS only builds Arm64.
Member
Author
|
@shahmishal, the CMake build workflow you asked for. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This workflow absorbs the boilerplate in installing and setting CMake builds across macOS, Linux, and Windows.
The workflow defaults to using CMake 4.0.3, and has the appropriate hashes for each architecture and platform. If you override the version, you will also need to provide the appropriate hashes for the platforms.
Each platform can be optionally enabled or disabled with the
enable_*_checks. By default, only Linux is tested, but macOS and Windows can both be enabled.Controlling each build is done with three commands for each platform:
*_pre_build_command*_configure_command*_build_commandThe pre-build command runs first, allowing you to install dependencies like Ninja. The
configurecommand is used to run CMake to configure the build. By default, this runs the platform-equivalent of$CMAKE -G Ninja -B build -S .. The build-command is for running the build. By default, it runs the platform-equivalent of$CMAKE --build buildEach of these commands has a
CMAKEandCTESTenvironment variable defined, specifying the path to the installed CMake and CTest binaries.Linux and Windows both run x86_64 and Arm64, while macOS only builds Arm64.