File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -232,12 +232,16 @@ 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
+
235
239
// Bindings
236
240
let bindings = bindgen:: Builder :: default ( )
237
241
. header ( "wrapper.h" )
238
242
. clang_arg ( format ! ( "-I{}" , llama_src. join( "include" ) . display( ) ) )
239
243
. clang_arg ( format ! ( "-I{}" , llama_src. join( "ggml/include" ) . display( ) ) )
240
- . clang_arg ( format ! ( "--target={}" , env :: var ( "HOST" ) . unwrap ( ) ) )
244
+ . clang_arg ( format ! ( "--target={}" , bindgen_target ) )
241
245
. parse_callbacks ( Box :: new ( bindgen:: CargoCallbacks :: new ( ) ) )
242
246
. derive_partialeq ( true )
243
247
. allowlist_function ( "ggml_.*" )
You can’t perform that action at this time.
0 commit comments