File tree Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Expand file tree Collapse file tree 1 file changed +2
-9
lines changed Original file line number Diff line number Diff line change @@ -232,16 +232,12 @@ fn main() {
232
232
. to_string ( ) ,
233
233
) ;
234
234
235
- let bindgen_target = env:: var ( "TARGET" ) . or_else ( |_| {
236
- env:: var ( "HOST" )
237
- } ) . expect ( "Failed to get TARGET or HOST environment variable" ) ;
238
-
239
235
// Bindings
240
236
let bindings = bindgen:: Builder :: default ( )
241
237
. header ( "wrapper.h" )
242
238
. clang_arg ( format ! ( "-I{}" , llama_src. join( "include" ) . display( ) ) )
243
239
. clang_arg ( format ! ( "-I{}" , llama_src. join( "ggml/include" ) . display( ) ) )
244
- . clang_arg ( format ! ( "--target={}" , bindgen_target ) )
240
+ . clang_arg ( format ! ( "--target={}" , target_triple ) )
245
241
. parse_callbacks ( Box :: new ( bindgen:: CargoCallbacks :: new ( ) ) )
246
242
. derive_partialeq ( true )
247
243
. allowlist_function ( "ggml_.*" )
@@ -315,10 +311,7 @@ fn main() {
315
311
} else {
316
312
config. define ( "ANDROID_PLATFORM" , "android-28" ) ;
317
313
}
318
- if target_triple. contains ( "aarch64" ) {
319
- config. cflag ( "-march=armv8.7a" ) ;
320
- config. cxxflag ( "-march=armv8.7a" ) ;
321
- } else if target_triple. contains ( "armv7" ) {
314
+ if target_triple. contains ( "aarch64" ) || target_triple. contains ( "armv7" ) {
322
315
config. cflag ( "-march=armv8.7a" ) ;
323
316
config. cxxflag ( "-march=armv8.7a" ) ;
324
317
} else if target_triple. contains ( "x86_64" ) {
You can’t perform that action at this time.
0 commit comments