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);