aboutsummaryrefslogtreecommitdiffhomepage
path: root/internal/rosa/cmake.go
diff options
context:
space:
mode:
authorOphestra <cat@gensokyo.uk>2026-01-25 01:32:21 +0900
committerOphestra <cat@gensokyo.uk>2026-01-25 01:43:18 +0900
commit20790af71ec9a69a462ecaaa7fc308e3b685383d (patch)
treee7cfdd8fec51c5dc37db88ad887c07dee947b600 /internal/rosa/cmake.go
parent43b8a40fc0e8d99bf29531d33f1f57d0c6e9df5e (diff)
internal/rosa: lazy initialise all artifacts
This improves performance, though not as drastically as lazy initialising llvm. Signed-off-by: Ophestra <cat@gensokyo.uk>
Diffstat (limited to 'internal/rosa/cmake.go')
-rw-r--r--internal/rosa/cmake.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/internal/rosa/cmake.go b/internal/rosa/cmake.go
index d26ce25c..4f2e6d2b 100644
--- a/internal/rosa/cmake.go
+++ b/internal/rosa/cmake.go
@@ -8,15 +8,14 @@ import (
"hakurei.app/internal/pkg"
)
-// NewCMake returns a [pkg.Artifact] containing an installation of CMake.
-func (t Toolchain) NewCMake() pkg.Artifact {
+func (t Toolchain) newCMake() pkg.Artifact {
const (
version = "4.2.1"
checksum = "Y3OdbMsob6Xk2y1DCME6z4Fryb5_TkFD7knRT8dTNIRtSqbiCJyyDN9AxggN_I75"
)
return t.New("cmake-"+version, []pkg.Artifact{
- t.NewMake(),
- t.NewKernelHeaders(),
+ t.Load(Make),
+ t.Load(KernelHeaders),
}, nil, nil, `
# expected to be writable in the copy made during bootstrap
chmod -R +w /usr/src/cmake/Tests
@@ -37,6 +36,7 @@ make DESTDIR=/work install
pkg.TarGzip,
)))
}
+func init() { artifactsF[CMake] = Toolchain.newCMake }
// CMakeAttr holds the project-specific attributes that will be applied to a new
// [pkg.Artifact] compiled via CMake.
@@ -95,8 +95,8 @@ chmod -R +w "${ROSA_SOURCE}"
sourcePath := AbsUsrSrc.Append(name)
return t.New(name+"-"+variant+"-"+version, stage3Concat(t, attr.Extra,
- t.NewCMake(),
- t.NewNinja(),
+ t.Load(CMake),
+ t.Load(Ninja),
), nil, slices.Concat([]string{
"ROSA_SOURCE=" + sourcePath.String(),
"ROSA_CMAKE_SOURCE=" + sourcePath.Append(attr.Append...).String(),