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()));