Merge pull request #1835 from aminya/clang

fix: better compiler detection on windows
This commit is contained in:
Amaan Qureshi 2023-07-11 19:19:44 -04:00 committed by GitHub
commit 51db0a1b5b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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 {