forked from security/hakurei
internal/rosa/cmake: optionally use makefile
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
|
Cache [][2]string
|
||||||
// Runs after install.
|
// Runs after install.
|
||||||
Script string
|
Script string
|
||||||
|
|
||||||
|
// Whether to generate Makefile instead.
|
||||||
|
Make bool
|
||||||
}
|
}
|
||||||
|
|
||||||
var _ Helper = new(CMakeHelper)
|
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].
|
// 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}
|
return []PArtifact{CMake, Ninja}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -173,8 +179,13 @@ func (attr *CMakeHelper) script(name string) string {
|
|||||||
panic("CACHE must be non-empty")
|
panic("CACHE must be non-empty")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
generate := "Ninja"
|
||||||
|
if attr.Make {
|
||||||
|
generate = "'Unix Makefiles'"
|
||||||
|
}
|
||||||
|
|
||||||
return `
|
return `
|
||||||
cmake -G Ninja \
|
cmake -G ` + generate + ` \
|
||||||
-DCMAKE_C_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
-DCMAKE_C_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
||||||
-DCMAKE_CXX_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
-DCMAKE_CXX_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
||||||
-DCMAKE_ASM_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
-DCMAKE_ASM_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
||||||
|
|||||||
Reference in New Issue
Block a user