@@ -155,7 +155,7 @@ fn write_tables() {
155
155
feature = "simd-accel" ,
156
156
any( target_arch = "x86_64" , target_arch = "aarch64" ) ,
157
157
not( target_env = "msvc" ) ,
158
- not( any( target_os = "android" , target_os = " ios") )
158
+ not( any( target_os = "ios" ) )
159
159
) ) ]
160
160
fn compile_simd_c ( ) {
161
161
let mut build = cc:: Build :: new ( ) ;
@@ -169,8 +169,11 @@ fn compile_simd_c() {
169
169
Err ( _error) => {
170
170
// On x86-64 enabling Haswell architecture unlocks useful instructions and improves performance
171
171
// dramatically while allowing it to run ony modern CPU.
172
- #[ cfg( target_arch = "x86_64" ) ]
173
- build. flag ( & "-march=haswell" ) ;
172
+ match env:: var ( "CARGO_CFG_TARGET_ARCH" ) . unwrap ( ) . as_str ( ) {
173
+ "x86_64" => drop ( build. flag ( & "-march=haswell" ) ) ,
174
+ "aarch64" => drop ( build. flag ( & "-march=armv8-a" ) ) ,
175
+ _ => ( )
176
+ }
174
177
}
175
178
}
176
179
@@ -184,7 +187,7 @@ fn compile_simd_c() {
184
187
feature = "simd-accel" ,
185
188
any( target_arch = "x86_64" , target_arch = "aarch64" ) ,
186
189
not( target_env = "msvc" ) ,
187
- not( any( target_os = "android" , target_os = " ios") )
190
+ not( any( target_os = "ios" ) )
188
191
) ) ) ]
189
192
fn compile_simd_c ( ) { }
190
193
0 commit comments