compileopts,targets: replace '{root}' in target files

This commit is contained in:
Damian Gryski
2021-12-18 10:58:20 -08:00
committed by Nia
parent 85031d6df7
commit 9eb13884de
2 changed files with 8 additions and 1 deletions
+7
View File
@@ -232,6 +232,13 @@ func LoadTarget(options *Options) (*TargetSpec, error) {
spec.ExtraFiles = append(spec.ExtraFiles, "src/internal/task/task_asyncify_wasm.S")
}
// TODO(dgryski): handle CFLAGS and LDFLAGS here too?
var emu []string
for _, s := range spec.Emulator {
emu = append(emu, strings.ReplaceAll(s, "{root}", goenv.Get("TINYGOROOT")))
}
spec.Emulator = emu
return spec, nil
}
+1 -1
View File
@@ -13,6 +13,6 @@
"--stack-first",
"--no-demangle"
],
"emulator": ["node", "targets/wasm_exec.js"],
"emulator": ["node", "{root}/targets/wasm_exec.js"],
"wasm-abi": "js"
}