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() {
232232 . to_string ( ) ,
233233 ) ;
234234
235- let bindgen_target = env:: var ( "TARGET" ) . or_else ( |_| {
236- env:: var ( "HOST" )
237- } ) . expect ( "Failed to get TARGET or HOST environment variable" ) ;
238-
239235 // Bindings
240236 let bindings = bindgen:: Builder :: default ( )
241237 . header ( "wrapper.h" )
242238 . clang_arg ( format ! ( "-I{}" , llama_src. join( "include" ) . display( ) ) )
243239 . clang_arg ( format ! ( "-I{}" , llama_src. join( "ggml/include" ) . display( ) ) )
244- . clang_arg ( format ! ( "--target={}" , bindgen_target ) )
240+ . clang_arg ( format ! ( "--target={}" , target_triple ) )
245241 . parse_callbacks ( Box :: new ( bindgen:: CargoCallbacks :: new ( ) ) )
246242 . derive_partialeq ( true )
247243 . allowlist_function ( "ggml_.*" )
@@ -315,10 +311,7 @@ fn main() {
315311 } else {
316312 config. define ( "ANDROID_PLATFORM" , "android-28" ) ;
317313 }
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" ) {
322315 config. cflag ( "-march=armv8.7a" ) ;
323316 config. cxxflag ( "-march=armv8.7a" ) ;
324317 } else if target_triple. contains ( "x86_64" ) {
You can’t perform that action at this time.
0 commit comments