Skip to content

actions: Add a configure-cmake-project action #999

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Steelskin
Copy link
Collaborator

@Steelskin Steelskin commented Jul 31, 2025

This brings in a modified version of Build-CMakeProject in build.ps1 from the swift repository as a custom action. This reduces the differences in the build setup between the swift repository and this repository, making it easier to keep both builds in sync.

The new reusable action only configures the CMake project in order to keep the build and install steps as separate steps in the GitHub Actions UI.

@Steelskin Steelskin requested review from compnerd and hjyamauchi July 31, 2025 18:43
@Steelskin
Copy link
Collaborator Author

Steelskin commented Jul 31, 2025

@compnerd I noticed we have a few differences in flags:

Flag name GHA swift-build Swift build.ps1
Android Debug CMAKE_[C|CXX]_FLAGS -g -gsplit-dwarf -gdwarf
Android CMAKE_[C|CXX]_FLAGS -ffunction-sections -fdata-sections (Nothing)
Windows CMAKE_*_LINKER_FLAGS -incremental:no -debug -opt:ref -opt:icf None, but these are passed to CMAKE_Swift_FLAGS with -Xlinker

Should we unify these? And if so, which way should we go?

@Steelskin Steelskin changed the title actions: Add a build-cmake-project action [WIP] actions: Add a build-cmake-project action Jul 31, 2025
@compnerd
Copy link
Owner

Should we unify these? And if so, which way should we go?

Yes, we should! For the Android side, actually the GHA is the ideal form. For the Windows side, the build.ps1 side is better IMO.

Comment on lines 25 to 28
os:
description: Operating system to build for (e.g., "Windows", "Android").
required: true
arch:
Copy link
Owner

Choose a reason for hiding this comment

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

Can we name these host-os and host-arch?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I do not think they should, as they can be either build, host or target depending on the job.

@Steelskin Steelskin force-pushed the fabrice/call-cmake-action branch 4 times, most recently from ca52164 to 90104d5 Compare August 1, 2025 18:36
@Steelskin Steelskin changed the title [WIP] actions: Add a build-cmake-project action actions: Add a configure-cmake-project action Aug 4, 2025
@Steelskin Steelskin requested a review from compnerd August 4, 2025 16:52
This brings in a modified version of `build.ps1` from the swift
repository as a custom action. This reduces the differences in the build
setup between the swift repository and this repository, making it easier
to keep both builds in sync.
@Steelskin Steelskin force-pushed the fabrice/call-cmake-action branch from 90104d5 to 3a1c55b Compare August 4, 2025 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants