Skip to content

Commit

Permalink
fix(bindings): use the same library name for all platforms in the xcf…
Browse files Browse the repository at this point in the history
…ramework

Fixes: #3528
Signed-off-by: Johannes Marbach <[email protected]>
  • Loading branch information
Johennes authored and bnjbvr committed Jun 12, 2024
1 parent 2a79956 commit f770248
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions xtask/src/swift.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
}
}
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f770248

Please sign in to comment.