aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/cmake.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-10-24 02:43:42 +0900
committerOphestra <cat@gensokyo.uk>2026-10-24 04:04:09 +0900
commit923149da444c7caa524a61880942a600c4c9e0bc (patch)
tree261fababa3622848e2aca46f7a3ea7b1b1e5bd4b /internal/rosa/cmake.go
parent8f1b287cf44f4baf2f235b2b7699e1dfb1dcaba3 (diff)
internal/rosa: bootstrap cmake in two steps
This enables cross-compilation via the standard CMake helper. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/cmake.go')
-rw-r--r--internal/rosa/cmake.go14
1 files changed, 12 insertions, 2 deletions
diff --git a/internal/rosa/cmake.go b/internal/rosa/cmake.go
index 8cfbf00c..2095c47a 100644
--- a/internal/rosa/cmake.go
+++ b/internal/rosa/cmake.go
@@ -7,6 +7,8 @@ import (
)
var (
+ _cmakeEarly = H("cmake-early")
+
_cmake = H("cmake")
_ninja = H("ninja")
)
@@ -16,6 +18,9 @@ type CMakeHelper struct {
// Path elements joined with source.
Append []string
+ // Use the bootstrap minimal [MakeHelper] CMake.
+ Early bool
+
// Value of CMAKE_BUILD_TYPE. The zero value is equivalent to "Release".
BuildType string
// CMake CACHE entries.
@@ -36,10 +41,15 @@ var _ Helper = new(CMakeHelper)
// tools returns the cmake handle alongside either ninja or make.
func (attr *CMakeHelper) tools(Toolchain) P {
+ h := _cmake
+ if attr != nil && attr.Early {
+ h = _cmakeEarly
+ }
+
if attr != nil && attr.Make {
- return P{_cmake, _make}
+ return P{h, _make}
}
- return P{_cmake, _ninja}
+ return P{h, _ninja}
}
// inputs is a noop.