Skip to content

Commit efec464

Browse files
committed
Refactor build script
1 parent 9ad48b8 commit efec464

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sha2/build.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,23 +5,23 @@ fn main() {
55
let target_vendor = env::var("CARGO_CFG_TARGET_VENDOR").unwrap_or_default();
66
let target_os = env::var("CARGO_CFG_TARGET_OS").unwrap_or_default();
77
let mut build256 = cc::Build::new();
8-
let (sha256_path, sha512_path) = if target_arch == "x86" {
9-
(["src/sha256_x86.S"].iter(), ["src/sha512_x86.S"].iter())
8+
let (sha256_path, sha512_path): (&[&str], &[&str]) = if target_arch == "x86" {
9+
(&["src/sha256_x86.S"], &["src/sha512_x86.S"])
1010
} else if target_arch == "x86_64" {
1111
if target_os == "linux" {
1212
(
13-
["src/sha256_x64_avx2.S", "src/sha256_x64.S"].iter(),
14-
["src/sha512_x64_avx2.S", "src/sha512_x64.S"].iter(),
13+
&["src/sha256_x64_avx2.S", "src/sha256_x64.S"],
14+
&["src/sha512_x64_avx2.S", "src/sha512_x64.S"],
1515
)
1616
} else {
17-
(["src/sha256_x64.S"].iter(), ["src/sha512_x64.S"].iter())
17+
(&["src/sha256_x64.S"], &["src/sha512_x64.S"])
1818
}
1919
} else if target_arch == "aarch64" && target_vendor == "apple" {
2020
build256.flag("-march=armv8-a+crypto");
21-
(["src/sha256_aarch64_apple.S"].iter(), [""].iter())
21+
(&["src/sha256_aarch64_apple.S"], &[""])
2222
} else if target_arch == "aarch64" {
2323
build256.flag("-march=armv8-a+crypto");
24-
(["src/sha256_aarch64.S"].iter(), [""].iter())
24+
(&["src/sha256_aarch64.S"], &[""])
2525
} else {
2626
panic!("Unsupported target architecture");
2727
};

0 commit comments

Comments
 (0)