File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change @@ -40,7 +40,8 @@ fn main() {
40
40
. flag_if_supported ( "/W1" ) ; // Reduce warnings verbosity
41
41
}
42
42
43
- if build. try_compile ( "usearch" ) . is_err ( ) {
43
+ let mut result = build. try_compile ( "usearch" ) ;
44
+ if result. is_err ( ) {
44
45
print ! ( "cargo:warning=Failed to compile with all SIMD backends..." ) ;
45
46
46
47
let target_arch = std:: env:: var ( "CARGO_CFG_TARGET_ARCH" ) . unwrap_or_default ( ) ;
@@ -54,20 +55,23 @@ fn main() {
54
55
] ,
55
56
} ;
56
57
57
- for flag in flags_to_try. iter ( ) {
58
+ for flag in flags_to_try {
58
59
build. define ( flag, "0" ) ;
59
- if build. try_compile ( "usearch" ) . is_ok ( ) {
60
+ result = build. try_compile ( "usearch" ) ;
61
+ if result. is_err ( ) {
62
+ println ! (
63
+ "cargo:warning=Failed to compile after disabling {}, trying next configuration..." ,
64
+ flag
65
+ ) ;
66
+ } else {
60
67
break ;
61
68
}
62
-
63
- // Print the failed configuration
64
- println ! (
65
- "cargo:warning=Failed to compile after disabling {}, trying next configuration..." ,
66
- flag
67
- ) ;
68
69
}
69
70
}
70
71
72
+ // Ensure one build has been successful
73
+ result. unwrap ( ) ;
74
+
71
75
println ! ( "cargo:rerun-if-changed=rust/lib.rs" ) ;
72
76
println ! ( "cargo:rerun-if-changed=rust/lib.cpp" ) ;
73
77
println ! ( "cargo:rerun-if-changed=rust/lib.hpp" ) ;
You can’t perform that action at this time.
0 commit comments