compileopts: move {root} replacement to compileopts.Emulator()

This commit is contained in:
Damian Gryski
2021-12-31 09:54:40 -08:00
committed by Ron Evans
parent cc1a95a489
commit ca2f25ed48
3 changed files with 37 additions and 30 deletions
+9
View File
@@ -463,6 +463,15 @@ func (c *Config) WasmAbi() string {
return c.Target.WasmAbi
}
// Emulator returns the emulator target config
func (c *Config) Emulator() []string {
var emulator []string
for _, s := range c.Target.Emulator {
emulator = append(emulator, strings.ReplaceAll(s, "{root}", goenv.Get("TINYGOROOT")))
}
return emulator
}
type TestConfig struct {
CompileTestBinary bool
// TODO: Filter the test functions to run, include verbose flag, etc
-7
View File
@@ -232,13 +232,6 @@ 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
}