From 18254ce361e8e2276b9cbd267623673b12ceee7e Mon Sep 17 00:00:00 2001 From: messense Date: Sun, 1 Dec 2024 08:57:50 +0800 Subject: [PATCH] Use different binding dirs for different uniffi modules --- src/module_writer.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/module_writer.rs b/src/module_writer.rs index 04103c0e9..df28e2402 100644 --- a/src/module_writer.rs +++ b/src/module_writer.rs @@ -1029,6 +1029,7 @@ fn uniffi_bindgen_command(crate_dir: &Path) -> Result { fn generate_uniffi_bindings( crate_dir: &Path, target_dir: &Path, + module_name: &str, target_os: Os, artifact: &Path, ) -> Result { @@ -1038,6 +1039,7 @@ fn generate_uniffi_bindings( .normalize()? .join("maturin") .join("uniffi") + .join(module_name) .into_path_buf(); fs::create_dir_all(&binding_dir)?; @@ -1154,7 +1156,7 @@ pub fn write_uniffi_module( names: binding_names, cdylib, path: binding_dir, - } = generate_uniffi_bindings(crate_dir, target_dir, target_os, artifact)?; + } = generate_uniffi_bindings(crate_dir, target_dir, module_name, target_os, artifact)?; let py_init = binding_names .iter()