mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-16 02:33:28 +00:00
builder: keep un-wasm-opt'd .wasm if -work was passed
This commit is contained in:
committed by
Damian Gryski
parent
b6fd0c818e
commit
272fea13e7
+9
-1
@@ -825,10 +825,18 @@ func Build(pkgName, outpath, tmpdir string, config *compileopts.Config) (BuildRe
|
|||||||
args = append(args, "--asyncify")
|
args = append(args, "--asyncify")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
exeunopt := result.Executable
|
||||||
|
|
||||||
|
if config.Options.Work {
|
||||||
|
// Keep the work direction around => don't overwrite the .wasm binary with the optimized version
|
||||||
|
exeunopt += ".pre-wasm-opt"
|
||||||
|
os.Rename(result.Executable, exeunopt)
|
||||||
|
}
|
||||||
|
|
||||||
args = append(args,
|
args = append(args,
|
||||||
opt,
|
opt,
|
||||||
"-g",
|
"-g",
|
||||||
result.Executable,
|
exeunopt,
|
||||||
"--output", result.Executable,
|
"--output", result.Executable,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user