Skip to content

Commit

Permalink
feat: Add buildflags to meson plugin
Browse files Browse the repository at this point in the history
- add BuildFlags to struct
- import strings
- pass build flags to meson command
  • Loading branch information
jardon authored and axtloss committed Sep 25, 2024
1 parent 30e4062 commit 2220192
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion plugins/meson.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@ import (
"C"
"encoding/json"
"fmt"
"strings"

"github.com/vanilla-os/vib/api"
)

type MesonModule struct {
Name string
Type string
BuildFlags []string `json:"buildflags"`
Source api.Source
}

Expand Down Expand Up @@ -54,8 +56,9 @@ func BuildModule(moduleInterface *C.char, recipeInterface *C.char) *C.char {
// it is safe to simply use the specified checksum from the module definition
tmpDir := fmt.Sprintf("/tmp/%s-%s", module.Source.Checksum, module.Name)
cmd := fmt.Sprintf(
"cd /sources/%s && meson %s && ninja -C %s && ninja -C %s install",
"cd /sources/%s && meson %s %s && ninja -C %s && ninja -C %s install",
api.GetSourcePath(module.Source, module.Name),
strings.Join(module.BuildFlags, " "),
tmpDir,
tmpDir,
tmpDir,
Expand Down

0 comments on commit 2220192

Please sign in to comment.