diff --git a/xbuild/src/cargo/mod.rs b/xbuild/src/cargo/mod.rs index 3af9284c..3a605452 100644 --- a/xbuild/src/cargo/mod.rs +++ b/xbuild/src/cargo/mod.rs @@ -298,7 +298,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()));