mirror of
https://github.com/hanzoai/pack.git
synced 2026-09-30 23:43:13 +00:00
- 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
32 lines
880 B
Go
32 lines
880 B
Go
package cpp
|
|
|
|
import (
|
|
"github.com/hanzoai/pack/core/generate"
|
|
"github.com/hanzoai/pack/core/plan"
|
|
)
|
|
|
|
type meson struct{}
|
|
|
|
func (p *CppProvider) DetectMeson(ctx *generate.GenerateContext) (buildSystem, bool) {
|
|
if ctx.App.HasFile("meson.build") {
|
|
return &meson{}, true
|
|
}
|
|
return nil, false
|
|
}
|
|
|
|
func (m *meson) Install(ctx *generate.GenerateContext, mise *generate.MiseStepBuilder) {
|
|
mise.Default("meson", "latest")
|
|
mise.Default("ninja", "latest")
|
|
// python + pipx are needed because of an installation issue with meson; this could be fixed in the future
|
|
mise.Default("python", "latest")
|
|
mise.Default("pipx", "latest")
|
|
mise.UseMiseVersions(ctx, []string{"meson", "ninja"})
|
|
}
|
|
|
|
func (m *meson) Build(build *generate.CommandStepBuilder) {
|
|
build.AddCommands([]plan.Command{
|
|
plan.NewExecCommand("meson setup /build"),
|
|
plan.NewExecCommand("meson compile -C /build"),
|
|
})
|
|
}
|