core/providers/cpp/cmake.go
core/providers/cpp/cmake.goBrowse 1970 files
211 tokens
730 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 cmake struct{}9 10func (p *CppProvider) DetectCmake(ctx *generate.GenerateContext) (buildSystem, bool) {11 if ctx.App.HasFile("CMakeLists.txt") {12 return &cmake{}, true13 }14 return nil, false15}16 17func (c *cmake) Install(ctx *generate.GenerateContext, mise *generate.MiseStepBuilder) {18 mise.Default("cmake", "latest")19 mise.Default("ninja", "latest")20 mise.UseMiseVersions(ctx, []string{"meson", "ninja"})21}22 23func (c *cmake) Build(build *generate.CommandStepBuilder) {24 build.AddCommands([]plan.Command{25 plan.NewExecCommand("cmake -B /build -GNinja /app"),26 plan.NewExecCommand("cmake --build /build"),27 })28}29