From 67f488bf76dc1b255412e632d0aa33d421e51cc4 Mon Sep 17 00:00:00 2001 From: Johannes Marbach Date: Tue, 11 Jun 2024 20:42:18 +0200 Subject: [PATCH] fix(bindings): use the same library name for all platforms in the xcframework Fixes: #3528 Signed-off-by: Johannes Marbach --- xtask/src/swift.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/xtask/src/swift.rs b/xtask/src/swift.rs index 30ce9c90c70..f00271c1155 100644 --- a/xtask/src/swift.rs +++ b/xtask/src/swift.rs @@ -98,13 +98,13 @@ impl Platform { } } - /// The name of the library for the platform once all architectures are - /// lipo'd together. - fn lib_name(&self) -> &str { + /// The name of the subfolder in which to place the library for the platform + /// once all architectures are lipo'd together. + fn lib_folder_name(&self) -> &str { match self { - Platform::Macos => "libmatrix_sdk_ffi_macos.a", - Platform::Ios => "libmatrix_sdk_ffi_ios.a", - Platform::IosSimulator => "libmatrix_sdk_ffi_iossimulator.a", + Platform::Macos => "macos", + Platform::Ios => "ios", + Platform::IosSimulator => "ios-simulator", } } } @@ -321,7 +321,10 @@ fn lipo_platform_libraries( continue; } - let output_path = generated_dir.join(platform.lib_name()); + let output_folder = generated_dir.join("lipo").join(platform.lib_folder_name()); + create_dir_all(&output_folder)?; + + let output_path = output_folder.join(FFI_LIBRARY_NAME); let mut cmd = cmd!("lipo -create"); for path in paths { cmd = cmd.arg(path);