Skip to content

Commit

Permalink
Fix cargo run uniffi-bindgen when cross compiling
Browse files Browse the repository at this point in the history
  • Loading branch information
messense committed Feb 10, 2025
1 parent e847908 commit 28f915a
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions src/module_writer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1053,14 +1053,18 @@ fn uniffi_bindgen_command(crate_dir: &Path) -> Result<Command> {

let command = if has_uniffi_bindgen_target {
let mut command = Command::new("cargo");
command.args(["run", "--bin", "uniffi-bindgen", "--manifest-path"]);
command.arg(manifest_path);
command.current_dir(crate_dir);
command
.args(["run", "--bin", "uniffi-bindgen", "--manifest-path"])
.arg(manifest_path)
.current_dir(crate_dir)
.env_remove("CARGO_BUILD_TARGET");
command
} else if has_uniffi_bindgen_workspace_package {
let mut command = Command::new("cargo");
command.args(["run", "--bin", "uniffi-bindgen"]);
command.current_dir(cargo_metadata.workspace_root);
command
.args(["run", "--bin", "uniffi-bindgen"])
.current_dir(cargo_metadata.workspace_root)
.env_remove("CARGO_BUILD_TARGET");
command
} else {
let mut command = Command::new("uniffi-bindgen");
Expand Down

0 comments on commit 28f915a

Please sign in to comment.