Skip to content

Commit 22356fc

Browse files
committed
Fix build script architecture check
1 parent b8aedfb commit 22356fc

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

build.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,12 @@ fn main() {
22
println!("cargo:rerun-if-changed=build.rs");
33

44
#[cfg(all(feature = "external_asm", windows))]
5-
compile_error!("\"external_asm\" feature is not available on windows!");
5+
compile_error!("\"external_asm\" feature is not available on windows toolchain!");
66

7-
#[cfg(all(feature = "instructions", not(target_arch = "x86_64")))]
8-
compile_error!("\"instructions\" feature is only available for x86_64 targets!");
7+
#[cfg(feature = "instructions")]
8+
if std::env::var("CARGO_CFG_TARGET_ARCH").unwrap() != "x86_64" {
9+
panic!("\"instructions\" feature is only available for x86_64 targets!");
10+
}
911

1012
#[cfg(all(
1113
feature = "instructions",

0 commit comments

Comments
 (0)