use new OUT_DIR for llvm wasm backend

This commit is contained in:
Folkert 2022-07-15 10:10:38 +02:00 committed by Folkert
parent ba7ffab790
commit 5f8d2df0fa
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C
2 changed files with 12 additions and 7 deletions

View file

@ -408,16 +408,13 @@ fn llvm_module_to_wasm_file(
.write_to_file(llvm_module, file_type, &test_a_path)
.unwrap();
let mut wasm_test_platform = std::env::current_dir().unwrap();
wasm_test_platform.push("build/wasm_test_platform.wasm");
use std::process::Command;
Command::new(&crate::helpers::zig_executable())
let output = Command::new(&crate::helpers::zig_executable())
.current_dir(dir_path)
.args(&[
"wasm-ld",
wasm_test_platform.to_str().unwrap(),
concat!(env!("OUT_DIR"), "/wasm_test_platform.wasm"),
test_a_path.to_str().unwrap(),
"-o",
test_wasm_path.to_str().unwrap(),
@ -425,9 +422,13 @@ fn llvm_module_to_wasm_file(
"--allow-undefined",
"--no-entry",
])
.status()
.output()
.unwrap();
assert!(output.status.success(), "{:#?}", output);
assert!(output.stdout.is_empty(), "{:#?}", output);
assert!(output.stderr.is_empty(), "{:#?}", output);
test_wasm_path
}