internal/rosa/cmake: optionally use makefile
All checks were successful
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 2m36s
Test / Hakurei (push) Successful in 3m42s
Test / ShareFS (push) Successful in 3m57s
Test / Sandbox (race detector) (push) Successful in 4m57s
Test / Hakurei (race detector) (push) Successful in 5m55s
Test / Flake checks (push) Successful in 1m30s
All checks were successful
Test / Create distribution (push) Successful in 59s
Test / Sandbox (push) Successful in 2m36s
Test / Hakurei (push) Successful in 3m42s
Test / ShareFS (push) Successful in 3m57s
Test / Sandbox (race detector) (push) Successful in 4m57s
Test / Hakurei (race detector) (push) Successful in 5m55s
Test / Flake checks (push) Successful in 1m30s
This breaks the dependency loop in zlib. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -128,6 +128,9 @@ type CMakeHelper struct {
|
||||
Cache [][2]string
|
||||
// Runs after install.
|
||||
Script string
|
||||
|
||||
// Whether to generate Makefile instead.
|
||||
Make bool
|
||||
}
|
||||
|
||||
var _ Helper = new(CMakeHelper)
|
||||
@@ -141,7 +144,10 @@ func (attr *CMakeHelper) name(name, version string) string {
|
||||
}
|
||||
|
||||
// extra returns a hardcoded slice of [CMake] and [Ninja].
|
||||
func (*CMakeHelper) extra(int) []PArtifact {
|
||||
func (attr *CMakeHelper) extra(int) []PArtifact {
|
||||
if attr != nil && attr.Make {
|
||||
return []PArtifact{CMake, Make}
|
||||
}
|
||||
return []PArtifact{CMake, Ninja}
|
||||
}
|
||||
|
||||
@@ -173,8 +179,13 @@ func (attr *CMakeHelper) script(name string) string {
|
||||
panic("CACHE must be non-empty")
|
||||
}
|
||||
|
||||
generate := "Ninja"
|
||||
if attr.Make {
|
||||
generate = "'Unix Makefiles'"
|
||||
}
|
||||
|
||||
return `
|
||||
cmake -G Ninja \
|
||||
cmake -G ` + generate + ` \
|
||||
-DCMAKE_C_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
||||
-DCMAKE_CXX_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
||||
-DCMAKE_ASM_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
||||
|
||||
Reference in New Issue
Block a user