diff options
Diffstat (limited to 'internal/rosa/cmake.go')
| -rw-r--r-- | internal/rosa/cmake.go | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/internal/rosa/cmake.go b/internal/rosa/cmake.go index 986f84d0..5f049dd0 100644 --- a/internal/rosa/cmake.go +++ b/internal/rosa/cmake.go @@ -42,6 +42,9 @@ func init() { artifactsF[CMake] = Toolchain.newCMake } // CMakeAttr holds the project-specific attributes that will be applied to a new // [pkg.Artifact] compiled via [CMake]. type CMakeAttr struct { + // Joined with name with a dash if non-empty. + Variant string + // Path elements joined with source. Append []string // Use source tree as scratch space. @@ -69,12 +72,12 @@ type CMakeAttr struct { // NewViaCMake returns a [pkg.Artifact] for compiling and installing via [CMake]. func (t Toolchain) NewViaCMake( - name, version, variant string, + name, version string, source pkg.Artifact, attr *CMakeAttr, extra ...pkg.Artifact, ) pkg.Artifact { - if name == "" || version == "" || variant == "" { + if name == "" || version == "" { panic("names must be non-empty") } if attr == nil { @@ -98,8 +101,13 @@ func (t Toolchain) NewViaCMake( prefix = AbsSystem } + rname := name + if attr.Variant != "" { + rname += "-" + attr.Variant + } + sourcePath := AbsUsrSrc.Append(name) - return t.New(name+"-"+variant+"-"+version, attr.Flag, stage0Concat(t, extra, + return t.New(rname+"-"+version, attr.Flag, stage0Concat(t, extra, t.Load(CMake), t.Load(Ninja), ), nil, slices.Concat([]string{ |
