diff --git a/build.rs b/build.rs index b9a01ba6..4b510ad4 100644 --- a/build.rs +++ b/build.rs @@ -85,6 +85,11 @@ fn build_v8() { gn_args.push("v8_enable_handle_zapping=false".to_string()); } + // Fix GN's host_cpu detection when using x86_64 bins on Apple Silicon + if cfg!(target_os = "macos") && cfg!(target_arch = "aarch64") { + gn_args.push("host_cpu=\"arm64\"".to_string()) + } + if let Some(clang_base_path) = find_compatible_system_clang() { println!("clang_base_path {}", clang_base_path.display()); gn_args.push(format!("clang_base_path={:?}", clang_base_path));