You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: crates/simd-test-macro/src/lib.rs
+11-1Lines changed: 11 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,17 @@ pub fn simd_test(
56
56
let name:TokenStream = name.as_str().parse()
57
57
.expect(&format!("failed to parse name: {}", name.clone().as_str()));
58
58
59
-
let target = env::var("TARGET").expect("TARGET environment variable not set");
59
+
let default_target = ifcfg!(target_os = "windows"){
60
+
Some("x86_64-pc-windows-msvc")
61
+
}elseifcfg!(target_os = "linux"){
62
+
Some("x86_64-unknown-linux-gnu")
63
+
}elseifcfg!(target_os = "macos"){
64
+
Some("x86_64-apple-darwin")
65
+
}else{
66
+
None
67
+
};
68
+
69
+
let target = env::var("TARGET").unwrap_or_else(|_| default_target.expect("TARGET environment variable not set and no default target known for the current target.").to_string());
60
70
letmut force_test = false;
61
71
let macro_test = match target.split('-').next()
62
72
.expect(&format!("target triple contained no \"-\": {}", target)){
0 commit comments