@@ -64,12 +64,15 @@ fn main() {
64
64
Ok ( s) => s == "true" ,
65
65
Err ( _) => false ,
66
66
} ;
67
+ log_var ! ( force_src) ;
67
68
68
- let target_os = target_os ( ) ;
69
- if !force_src
70
- && target_arch ( ) == "x86_64"
71
- && ( target_os == "linux" || target_os == "macos" || target_os == "windows" )
72
- {
69
+ let prebuilt_supported = match ( & target_arch ( ) as & str , & target_os ( ) as & str ) {
70
+ ( "x86_64" , "linux" ) => true ,
71
+ ( "x86_64" , "windows" ) => true ,
72
+ ( "aarch64" , "macos" ) => true ,
73
+ _ => false ,
74
+ } ;
75
+ if !force_src && prebuilt_supported {
73
76
install_prebuilt ( ) ;
74
77
} else {
75
78
build_from_src ( ) ;
@@ -185,11 +188,17 @@ fn extract<P: AsRef<Path>, P2: AsRef<Path>>(archive_path: P, extract_to: P2) {
185
188
186
189
// Downloads and unpacks a prebuilt binary. Only works for certain platforms.
187
190
fn install_prebuilt ( ) {
191
+ log ! ( "Installing prebuilt" ) ;
188
192
// Figure out the file names.
189
193
let os = match & target_os ( ) as & str {
190
194
"macos" => "darwin" . to_string ( ) ,
191
195
x => x. to_string ( ) ,
192
196
} ;
197
+ let arch = match & target_arch ( ) as & str {
198
+ "aarch64" => "arm64" ,
199
+ x => x,
200
+ }
201
+ . to_string ( ) ;
193
202
let proc_type = if cfg ! ( feature = "tensorflow_gpu" ) {
194
203
"gpu"
195
204
} else {
@@ -301,6 +310,7 @@ fn symlink<P: AsRef<Path>, P2: AsRef<Path>>(target: P, link: P2) {
301
310
}
302
311
303
312
fn build_from_src ( ) {
313
+ log ! ( "Building from source" ) ;
304
314
let dll_suffix = dll_suffix ( ) ;
305
315
let framework_target = FRAMEWORK_TARGET . to_string ( ) + dll_suffix;
306
316
let target = TARGET . to_string ( ) + dll_suffix;
0 commit comments