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() {
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+
235239 // Bindings
236240 let bindings = bindgen:: Builder :: default ( )
237241 . header ( "wrapper.h" )
238242 . clang_arg ( format ! ( "-I{}" , llama_src. join( "include" ) . display( ) ) )
239243 . 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 ) )
241245 . parse_callbacks ( Box :: new ( bindgen:: CargoCallbacks :: new ( ) ) )
242246 . derive_partialeq ( true )
243247 . allowlist_function ( "ggml_.*" )
You can’t perform that action at this time.
0 commit comments