From b10b1dcd2800ccafca35782d655c23a9e970bcb0 Mon Sep 17 00:00:00 2001 From: "Jason S. Clary" Date: Tue, 15 Aug 2023 07:53:05 -0500 Subject: [PATCH] Only add clang target if it differs from the host. --- xbuild/src/cargo/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbuild/src/cargo/mod.rs b/xbuild/src/cargo/mod.rs index 5fda3a61..adb91766 100644 --- a/xbuild/src/cargo/mod.rs +++ b/xbuild/src/cargo/mod.rs @@ -295,7 +295,9 @@ impl CargoBuild { target_sdk_version ); self.use_ld("lld"); - self.add_link_arg(&format!("--target={}", self.triple.unwrap_or(ndk_triple))); + if let Some(triple) = self.triple { + self.add_link_arg(&format!("--target={}", triple)); + } self.add_link_arg(&format!("-B{}", sdk_lib_dir.display())); self.add_link_arg(&format!("-L{}", sdk_lib_dir.display())); self.add_link_arg(&format!("-L{}", lib_dir.display()));