fix(build): don't hardcode go command in build script

This commit is contained in:
Erica Marigold 2024-07-18 17:57:44 +05:30
parent 2cd7e2cc45
commit 983b343315
No known key found for this signature in database
GPG key ID: 2768CC0C23D245D1

View file

@ -71,13 +71,13 @@ func main() {
buildVm(artifactPath, cmakeFlags...) buildVm(artifactPath, cmakeFlags...)
} }
buildArgs := []string{"build"} buildTags := []string{}
if len(features) > 0 { if len(features) > 0 {
buildArgs = append(buildArgs, []string{"-tags", strings.Join(features, ",")}...) buildTags = append(buildTags, []string{"-tags", strings.Join(features, ",")}...)
} }
cmd, _, _, _ := Command("go"). cmd, _, _, _ := Command("go").
WithArgs(append(buildArgs, goArgs...)...). WithArgs(append(buildTags, goArgs...)...).
WithVar( WithVar(
"CGO_LDFLAGS", "CGO_LDFLAGS",
fmt.Sprintf("-L %s -lLuau.VM -lm -lstdc++", artifactDir), fmt.Sprintf("-L %s -lLuau.VM -lm -lstdc++", artifactDir),