Use gcc instead of cc, fix wasmer/lib/c-api in wasmer_base_dir string

This commit is contained in:
Felix Schütt
2022-09-15 14:46:41 +02:00
parent 4f9b9a82cd
commit 219d0c0278
3 changed files with 36 additions and 6 deletions

View File

@@ -480,9 +480,14 @@ impl CreateExe {
include_dir.pop();
include_dir.push("include");
let compiler_cmd = match std::process::Command::new("cc").output() {
Ok(_) => "cc",
Err(_) => "gcc",
};
let mut cmd = Command::new(zig_binary_path);
let mut cmd_mut: &mut Command = cmd
.arg("cc")
.arg(compiler_cmd)
.arg("-w")
.arg("-fgnu-inline-asm")
.arg("-fsanitize=undefined")
@@ -549,7 +554,13 @@ impl CreateExe {
/* Compile main function */
let compilation = {
Command::new("cc")
let compiler_cmd = match Command::new("cc").output() {
Ok(_) => "cc",
Err(_) => "gcc",
};
Command::new(compiler_cmd)
.arg("-c")
.arg(&c_src_path)
.arg(if linkcode.optimization_flag.is_empty() {