Skip to content

Commit

Permalink
Set compiler argument '-march:SSE2' only if target is Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
dpino committed May 7, 2024
1 parent 0b63127 commit b390587
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -232,9 +232,10 @@ fn build_lib(compiled_libraries: &mut HashSet<Libs>, target: &String, lib: Libs)
.flag_if_supported("/wd9002");

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

// Enable multiprocessing for faster builds.
Expand Down Expand Up @@ -294,9 +295,10 @@ 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
build.flag_if_supported("-msse2"); // GNU
if target.contains("windows") {
build.flag_if_supported("-arch:SSE2"); // MSVC
}
}

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

0 comments on commit b390587

Please sign in to comment.