Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jul 24, 2025

Updates the iOS build system to generate static libraries (.a files) instead of dynamic libraries, enabling iOS apps to be submitted to the App Store without rejection.

Problem

The previous iOS builds were completely disabled with the comment "Don't build iphone binary as we cannot use dylibs." Apple requires that libraries be statically linked into the final binary for iOS apps submitted to the App Store.

Solution

This PR converts the iOS build process to create static libraries for all iOS platforms:

Key Changes

  1. Re-enabled iOS device builds - Uncommented and fixed the ios-arm64 build for actual iOS devices
  2. Static library generation - Added -DLIBTYPE=STATIC CMake flag to build libopenal.a instead of libopenal.dylib
  3. Complete architecture support - Now builds static libraries for all iOS targets:
    • ios-arm64: Actual iOS devices (iPhone/iPad)
    • iossimulator-x64: Intel-based iOS simulators
    • iossimulator-arm64: Apple Silicon iOS simulators
  4. Direct NuGet packaging - Places static libraries directly in artifacts directories like macOS dylibs

Output Structure

The generated static libraries are placed in standard artifacts directories:

artifacts/
├── ios-arm64/libopenal.a          # iOS devices
├── iossimulator-x64/libopenal.a   # Intel simulators
└── iossimulator-arm64/libopenal.a # Apple Silicon simulators

Benefits

  • App Store compatible: Static libraries can be submitted without rejection
  • Simple integration: Direct library files ready for NuGet packaging
  • No API changes: Existing OpenAL code continues to work unchanged
  • Complete coverage: Supports all iOS architectures including actual devices

iOS developers can now link these static libraries in their Xcode projects and successfully submit to the App Store.

Fixes #8.


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Co-authored-by: dellis1972 <810617+dellis1972@users.noreply.github.com>
Copilot AI changed the title [WIP] Update the iOS binaries to be a Framework rather than dylibs Convert iOS binaries from dylibs to frameworks for App Store compatibility Jul 24, 2025
Copilot AI requested a review from dellis1972 July 24, 2025 08:34
…ke platform support accurate

Co-authored-by: dellis1972 <810617+dellis1972@users.noreply.github.com>
@dellis1972
Copy link
Contributor

Is there a way to generate a single OpenAL.framework package which will support both iOS Devices and Simulators? Can we use the otool or lipo to merge the various binaries? Will that work when compiling the final app?

…tures

Co-authored-by: dellis1972 <810617+dellis1972@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 24, 2025

Is there a way to generate a single OpenAL.framework package which will support both iOS Devices and Simulators? Can we use the otool or lipo to merge the various binaries? Will that work when com...

Yes! I've implemented exactly what you suggested in commit f0e7d3e. The build now creates a single universal OpenAL.framework that supports both iOS devices and simulators using lipo to merge the individual architecture binaries.

Key changes:

  • Individual architectures are still built first (ios-arm64, iossimulator-x64, iossimulator-arm64)
  • lipo -create is used to merge all static libraries into a single universal binary
  • The universal framework's Info.plist supports both iPhoneOS and iPhoneSimulator platforms
  • The framework is created at artifacts/ios/OpenAL.framework for easy integration

This approach follows standard iOS distribution practices and will make it much easier for developers - they just need to embed one framework instead of choosing between architecture-specific ones.

@dellis1972
Copy link
Contributor

can you fix this issue ?

fatal error: /Applications/Xcode_15.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/lipo: artifacts/ios-arm64/OpenAL.framework/OpenAL and artifacts/iossimulator-arm64/OpenAL.framework/OpenAL have the same architectures (arm64) and can't be in the same fat output file
Created universal iOS framework at: artifacts/ios/OpenAL.framework

Co-authored-by: dellis1972 <810617+dellis1972@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 24, 2025

can you fix this issue ?

...

Fixed in commit 8c944ad. The issue was that both ios-arm64 (device) and iossimulator-arm64 (simulator) use the same arm64 architecture, which lipo cannot combine into a single fat binary.

The solution detects architecture conflicts using lipo -info and prioritizes device binaries over simulator binaries when there are duplicate architectures. This ensures successful universal framework creation while maintaining maximum platform coverage.

@dellis1972
Copy link
Contributor

will an arm64 binary build against the device sdk work on the ios simulator?

Copy link
Contributor Author

Copilot AI commented Jul 24, 2025

will an arm64 binary build against the device sdk work on the ios simulator?

No, an arm64 binary built against the device SDK will not work reliably on the iOS simulator. Even though both use arm64 architecture on Apple Silicon Macs, they require different SDKs:

  • iOS device binaries compile against the iphoneos SDK
  • iOS simulator binaries must compile against the iphonesimulator SDK

These SDKs have different system libraries, frameworks, and runtime behavior. The simulator runs on macOS with different ABI requirements than actual iOS devices.

The current conflict resolution logic prioritizing device builds over simulator builds when both use arm64 is problematic - it means the universal framework won't work properly on simulators. We should consider a different approach, such as using XCFrameworks which can properly contain both device and simulator binaries for the same architecture.

@dellis1972
Copy link
Contributor

ok can you go ahead and change the Universal system to not use lipo but instead produce a XCFramework

Copilot AI requested a review from dellis1972 July 24, 2025 15:55
Co-authored-by: dellis1972 <810617+dellis1972@users.noreply.github.com>
@dellis1972
Copy link
Contributor

ok this is looking good . I made some changes. One last thing that is missing is we need to include the openal-soft LICENSE-pffft file in the OpenAL.framework folders. It should be named LICENSE, and we should include the openal-soft README as well.

Co-authored-by: dellis1972 <810617+dellis1972@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 25, 2025

ok this is looking good . I made some changes. One last thing that is missing is we need to include the openal-soft LICENSE-pffft file in the OpenAL.framework folders. It should be named LICENSE, and ...

Added LICENSE and README files to iOS frameworks in commit 46fa8d8. The openal-soft LICENSE-pffft file is now copied as "LICENSE" and the README.md is copied as "README" to both the individual device/simulator frameworks and the final XCFramework structure.

@dellis1972
Copy link
Contributor

ok, so thanks for all the hard work on this. However we have a slight change of plan.
Instead of shipping an OpenAL.xcframework. We are instead just going to place the OpenAL static libraries for ios, iossimulator-x64 and iossimulator-arm64 directly in the nuget package like we do with the dylib for macos.
So we need to remove all the code which deals with createing .frameworks and .xcframeworks. But keep the code which staticly compiles the OpenAL libraries for ios and the ios simualtors. But place those in artifacts like ios-arm64, iossimulator-x64 and iossimulator-arm64.

…y in artifacts

Co-authored-by: dellis1972 <810617+dellis1972@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jul 30, 2025

ok, so thanks for all the hard work on this. However we have a slight change of plan.
Instead of shipping an OpenAL.xcframework. We are instead just going to place the OpenAL static libraries for io...

Done! Removed all framework and XCFramework creation code as requested in commit a6adec6. The iOS build now:

  • Keeps static library compilation (-DLIBTYPE=STATIC) for all platforms
  • Places static libraries directly in artifacts directories:
    • artifacts/ios-arm64/libopenal.a
    • artifacts/iossimulator-x64/libopenal.a
    • artifacts/iossimulator-arm64/libopenal.a
  • Follows the same pattern as macOS dylib packaging

This eliminates 231 lines of framework packaging complexity while maintaining the core static library builds for iOS App Store compatibility.

Copilot AI changed the title Convert iOS binaries from dylibs to frameworks for App Store compatibility Convert iOS builds to static libraries for App Store compatibility Jul 30, 2025
@dellis1972 dellis1972 marked this pull request as ready for review July 30, 2025 22:44
@dellis1972 dellis1972 requested a review from ThomasFOG July 31, 2025 07:52
@ThomasFOG ThomasFOG merged commit 4665729 into main Jul 31, 2025
5 checks passed
@ThomasFOG ThomasFOG deleted the copilot/fix-8 branch July 31, 2025 07:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update the iOS binaries to be a Framework rather than dylibs

2 participants