core/providers/cpp/meson.go
core/providers/cpp/meson.goBrowse 1970 files
249 tokens
894 bytes
Token encoding: o200k_base
Snapshot 21a254f
← Back to SKILL.md
1package cpp2 3import (4 "github.com/railwayapp/railpack/core/generate"5 "github.com/railwayapp/railpack/core/plan"6)7 8type meson struct{}9 10func (p *CppProvider) DetectMeson(ctx *generate.GenerateContext) (buildSystem, bool) {11 if ctx.App.HasFile("meson.build") {12 return &meson{}, true13 }14 return nil, false15}16 17func (m *meson) Install(ctx *generate.GenerateContext, mise *generate.MiseStepBuilder) {18 mise.Default("meson", "latest")19 mise.Default("ninja", "latest")20 // python + pipx are needed because of an installation issue with meson; this could be fixed in the future21 mise.Default("python", "latest")22 mise.Default("pipx", "latest")23 mise.UseMiseVersions(ctx, []string{"meson", "ninja"})24}25 26func (m *meson) Build(build *generate.CommandStepBuilder) {27 build.AddCommands([]plan.Command{28 plan.NewExecCommand("meson setup /build"),29 plan.NewExecCommand("meson compile -C /build"),30 })31}32