mirror of
https://github.com/mii443/wasmer.git
synced 2025-12-07 05:08:19 +00:00
Fix -target error
This commit is contained in:
@@ -743,17 +743,20 @@ fn run_c_compile(
|
|||||||
let c_compiler = "clang++";
|
let c_compiler = "clang++";
|
||||||
|
|
||||||
let mut command = Command::new(c_compiler);
|
let mut command = Command::new(c_compiler);
|
||||||
let command = command
|
let mut command = command
|
||||||
.arg("-Wall")
|
.arg("-Wall")
|
||||||
.arg("-O2")
|
.arg("-O2")
|
||||||
.arg("-c")
|
.arg("-c")
|
||||||
.arg(path_to_c_src)
|
.arg(path_to_c_src)
|
||||||
.arg("-I")
|
.arg("-I")
|
||||||
.arg(utils::get_wasmer_include_directory()?)
|
.arg(utils::get_wasmer_include_directory()?);
|
||||||
.arg("-target")
|
|
||||||
.arg(format!("{}", target))
|
// On some compiler -target isn't implemented
|
||||||
.arg("-o")
|
if *target != Triple::host() {
|
||||||
.arg(output_name);
|
command = command.arg("-target").arg(format!("{}", target));
|
||||||
|
}
|
||||||
|
|
||||||
|
let command = command.arg("-o").arg(output_name);
|
||||||
|
|
||||||
if debug {
|
if debug {
|
||||||
println!("{command:#?}");
|
println!("{command:#?}");
|
||||||
@@ -1684,6 +1687,12 @@ pub(super) mod utils {
|
|||||||
}
|
}
|
||||||
path.push("include");
|
path.push("include");
|
||||||
if !path.clone().join("wasmer.h").exists() {
|
if !path.clone().join("wasmer.h").exists() {
|
||||||
|
if !path.exists() {
|
||||||
|
return Err(anyhow::anyhow!(
|
||||||
|
"WASMER_DIR path {} does not exist",
|
||||||
|
path.display()
|
||||||
|
));
|
||||||
|
}
|
||||||
println!(
|
println!(
|
||||||
"wasmer.h does not exist in {}, will probably default to the system path",
|
"wasmer.h does not exist in {}, will probably default to the system path",
|
||||||
path.canonicalize().unwrap().display()
|
path.canonicalize().unwrap().display()
|
||||||
|
|||||||
Reference in New Issue
Block a user