internal/rosa/cmake: implicit CMAKE_BUILD_TYPE
All checks were successful
Test / Create distribution (push) Successful in 1m33s
Test / Sandbox (push) Successful in 4m42s
Test / ShareFS (push) Successful in 8m24s
Test / Sandbox (race detector) (push) Successful in 8m35s
Test / Hakurei (race detector) (push) Successful in 11m41s
Test / Hakurei (push) Successful in 6m27s
Test / Flake checks (push) Successful in 3m35s
All checks were successful
Test / Create distribution (push) Successful in 1m33s
Test / Sandbox (push) Successful in 4m42s
Test / ShareFS (push) Successful in 8m24s
Test / Sandbox (race detector) (push) Successful in 8m35s
Test / Hakurei (race detector) (push) Successful in 11m41s
Test / Hakurei (push) Successful in 6m27s
Test / Flake checks (push) Successful in 3m35s
Lack of this behaviour is a holdover from when the helper was first split from the (now removed) LLVM helper. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -122,6 +122,8 @@ type CMakeHelper struct {
|
|||||||
// Path elements joined with source.
|
// Path elements joined with source.
|
||||||
Append []string
|
Append []string
|
||||||
|
|
||||||
|
// Value of CMAKE_BUILD_TYPE. The zero value is equivalent to "Release".
|
||||||
|
BuildType string
|
||||||
// CMake CACHE entries.
|
// CMake CACHE entries.
|
||||||
Cache []KV
|
Cache []KV
|
||||||
// Runs after install.
|
// Runs after install.
|
||||||
@@ -164,14 +166,7 @@ func (*CMakeHelper) wantsDir() string { return "/cure/" }
|
|||||||
// script generates the cure script.
|
// script generates the cure script.
|
||||||
func (attr *CMakeHelper) script(name string) string {
|
func (attr *CMakeHelper) script(name string) string {
|
||||||
if attr == nil {
|
if attr == nil {
|
||||||
attr = &CMakeHelper{
|
attr = new(CMakeHelper)
|
||||||
Cache: []KV{
|
|
||||||
{"CMAKE_BUILD_TYPE", "Release"},
|
|
||||||
},
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if len(attr.Cache) == 0 {
|
|
||||||
panic("CACHE must be non-empty")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
generate := "Ninja"
|
generate := "Ninja"
|
||||||
@@ -189,6 +184,13 @@ func (attr *CMakeHelper) script(name string) string {
|
|||||||
script += "\n" + test
|
script += "\n" + test
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cache := make([]KV, 1, 1+len(attr.Cache))
|
||||||
|
cache[0] = KV{"CMAKE_BUILD_TYPE", "Release"}
|
||||||
|
if attr.BuildType != "" {
|
||||||
|
cache[0][1] = attr.BuildType
|
||||||
|
}
|
||||||
|
cache = append(cache, attr.Cache...)
|
||||||
|
|
||||||
return `
|
return `
|
||||||
cmake -G ` + generate + ` \
|
cmake -G ` + generate + ` \
|
||||||
-DCMAKE_C_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
-DCMAKE_C_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
||||||
@@ -196,7 +198,7 @@ cmake -G ` + generate + ` \
|
|||||||
-DCMAKE_ASM_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
-DCMAKE_ASM_COMPILER_TARGET="${ROSA_TRIPLE}" \
|
||||||
-DCMAKE_INSTALL_LIBDIR=lib \
|
-DCMAKE_INSTALL_LIBDIR=lib \
|
||||||
` + strings.Join(slices.Collect(func(yield func(string) bool) {
|
` + strings.Join(slices.Collect(func(yield func(string) bool) {
|
||||||
for _, v := range attr.Cache {
|
for _, v := range cache {
|
||||||
if !yield("-D" + v[0] + "=" + v[1]) {
|
if !yield("-D" + v[0] + "=" + v[1]) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,10 +17,6 @@ func (t Toolchain) newSPIRVHeaders() (pkg.Artifact, string) {
|
|||||||
"vulkan-sdk-"+version,
|
"vulkan-sdk-"+version,
|
||||||
checksum,
|
checksum,
|
||||||
), nil, &CMakeHelper{
|
), nil, &CMakeHelper{
|
||||||
Cache: []KV{
|
|
||||||
{"CMAKE_BUILD_TYPE", "Release"},
|
|
||||||
},
|
|
||||||
|
|
||||||
// upstream has no tests
|
// upstream has no tests
|
||||||
SkipTest: true,
|
SkipTest: true,
|
||||||
}), version
|
}), version
|
||||||
@@ -67,7 +63,6 @@ func (t Toolchain) newSPIRVTools() (pkg.Artifact, string) {
|
|||||||
checksum,
|
checksum,
|
||||||
), nil, &CMakeHelper{
|
), nil, &CMakeHelper{
|
||||||
Cache: []KV{
|
Cache: []KV{
|
||||||
{"CMAKE_BUILD_TYPE", "Release"},
|
|
||||||
{"SPIRV-Headers_SOURCE_DIR", "/system"},
|
{"SPIRV-Headers_SOURCE_DIR", "/system"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -109,7 +104,6 @@ func (t Toolchain) newGlslang() (pkg.Artifact, string) {
|
|||||||
Chmod: true,
|
Chmod: true,
|
||||||
}, &CMakeHelper{
|
}, &CMakeHelper{
|
||||||
Cache: []KV{
|
Cache: []KV{
|
||||||
{"CMAKE_BUILD_TYPE", "Release"},
|
|
||||||
{"BUILD_SHARED_LIBS", "ON"},
|
{"BUILD_SHARED_LIBS", "ON"},
|
||||||
{"ALLOW_EXTERNAL_SPIRV_TOOLS", "ON"},
|
{"ALLOW_EXTERNAL_SPIRV_TOOLS", "ON"},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ import (
|
|||||||
|
|
||||||
func (t Toolchain) newLLVM() (pkg.Artifact, string) {
|
func (t Toolchain) newLLVM() (pkg.Artifact, string) {
|
||||||
cache := []KV{
|
cache := []KV{
|
||||||
{"CMAKE_BUILD_TYPE", "Release"},
|
|
||||||
|
|
||||||
{"ENABLE_LINKER_BUILD_ID", "ON"},
|
{"ENABLE_LINKER_BUILD_ID", "ON"},
|
||||||
{"COMPILER_RT_USE_BUILTINS_LIBRARY", "ON"},
|
{"COMPILER_RT_USE_BUILTINS_LIBRARY", "ON"},
|
||||||
{"COMPILER_RT_DEFAULT_TARGET_ONLY", "ON"},
|
{"COMPILER_RT_DEFAULT_TARGET_ONLY", "ON"},
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ func (t Toolchain) newZlib() (pkg.Artifact, string) {
|
|||||||
pkg.TarGzip,
|
pkg.TarGzip,
|
||||||
), nil, &CMakeHelper{
|
), nil, &CMakeHelper{
|
||||||
Cache: []KV{
|
Cache: []KV{
|
||||||
{"CMAKE_BUILD_TYPE", "Release"},
|
|
||||||
|
|
||||||
{"CMAKE_C_FLAGS", "-fPIC"},
|
{"CMAKE_C_FLAGS", "-fPIC"},
|
||||||
{"ZLIB_BUILD_TESTING", "ON"},
|
{"ZLIB_BUILD_TESTING", "ON"},
|
||||||
{"ZLIB_BUILD_SHARED", "ON"},
|
{"ZLIB_BUILD_SHARED", "ON"},
|
||||||
|
|||||||
@@ -19,9 +19,6 @@ func (t Toolchain) newZstd() (pkg.Artifact, string) {
|
|||||||
Chmod: true,
|
Chmod: true,
|
||||||
}, &CMakeHelper{
|
}, &CMakeHelper{
|
||||||
Append: []string{"build", "cmake"},
|
Append: []string{"build", "cmake"},
|
||||||
Cache: []KV{
|
|
||||||
{"CMAKE_BUILD_TYPE", "Release"},
|
|
||||||
},
|
|
||||||
Test: `
|
Test: `
|
||||||
make -C /usr/src/zstd/tests datagen
|
make -C /usr/src/zstd/tests datagen
|
||||||
ZSTD_BIN=/cure/programs/zstd /usr/src/zstd/tests/playTests.sh
|
ZSTD_BIN=/cure/programs/zstd /usr/src/zstd/tests/playTests.sh
|
||||||
|
|||||||
Reference in New Issue
Block a user