diff --git a/cli/loader/src/lib.rs b/cli/loader/src/lib.rs index 029da451..30cec2ca 100644 --- a/cli/loader/src/lib.rs +++ b/cli/loader/src/lib.rs @@ -377,7 +377,7 @@ impl Loader { command.env(key, value); } - if cfg!(windows) { + if compiler.is_like_msvc() { command.args(&["/nologo", "/LD", "/I"]).arg(header_path); if self.debug_build { command.arg("/Od"); @@ -394,7 +394,6 @@ impl Loader { } else { command .arg("-shared") - .arg("-fPIC") .arg("-fno-exceptions") .arg("-g") .arg("-I") @@ -402,6 +401,10 @@ impl Loader { .arg("-o") .arg(&library_path); + if !cfg!(windows) { + command.arg("-fPIC"); + } + if self.debug_build { command.arg("-O0"); } else {