Files
pack/core/providers/cpp/cmake.go
T
zeekay 7844a60aff refactor(pack): modernize to github.com/hanzoai/pack and remove upstream branding
- Migrate module path to github.com/hanzoai/pack across all Go packages
- Remove legacy upstream docs and competitor brand references
- Modernize LLM.md and mise.toml for pristine Hanzo Pack builder
2026-09-04 00:40:42 -07:00

29 lines
716 B
Go

package cpp
import (
"github.com/hanzoai/pack/core/generate"
"github.com/hanzoai/pack/core/plan"
)
type cmake struct{}
func (p *CppProvider) DetectCmake(ctx *generate.GenerateContext) (buildSystem, bool) {
if ctx.App.HasFile("CMakeLists.txt") {
return &cmake{}, true
}
return nil, false
}
func (c *cmake) Install(ctx *generate.GenerateContext, mise *generate.MiseStepBuilder) {
mise.Default("cmake", "latest")
mise.Default("ninja", "latest")
mise.UseMiseVersions(ctx, []string{"meson", "ninja"})
}
func (c *cmake) Build(build *generate.CommandStepBuilder) {
build.AddCommands([]plan.Command{
plan.NewExecCommand("cmake -B /build -GNinja /app"),
plan.NewExecCommand("cmake --build /build"),
})
}