Skip to content

Commit

Permalink
Set compiler argument '-march:SSE2' only if target is Windows (#78)
Browse files Browse the repository at this point in the history
  • Loading branch information
dpino authored Aug 7, 2024
1 parent 6f2f98e commit f9d5dd4
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,11 @@ fn build_lib(compiled_libraries: &mut HashSet<Libs>, target: &String, lib: Libs)
.flag_if_supported("-Wno-unused-command-line-argument");

if target.contains("x86_64") || target.contains("i686") {
build
.flag_if_supported("-msse2") // GNU
.flag_if_supported("-arch:SSE2"); // MSVC
if build.get_compiler().is_like_msvc() {
build.flag_if_supported("-arch:SSE2");
} else {
build.flag_if_supported("-msse2");
}
}

// Enable multiprocessing for faster builds.
Expand Down Expand Up @@ -300,9 +302,11 @@ fn build_translator(compiled_libraries: &mut HashSet<Libs>, target: &String) {
.flag_if_supported("/wd9002");

if target.contains("x86_64") || target.contains("i686") {
build
.flag_if_supported("-msse2") // GNU
.flag_if_supported("-arch:SSE2"); // MSVC
if build.get_compiler().is_like_msvc() {
build.flag_if_supported("-arch:SSE2");
} else {
build.flag_if_supported("-msse2");
}
}

let out_dir = PathBuf::from(env::var_os("OUT_DIR").unwrap());
Expand Down

0 comments on commit f9d5dd4

Please sign in to comment.