KEMBAR78
Use scummvm-ios7-libs-v3 by larsamannen · Pull Request #4856 · scummvm/scummvm · GitHub
Skip to content

Conversation

@larsamannen
Copy link
Contributor

The scummvm-ios7-libs-v3 packages the pre-built static libraries into xcframeworks, allowing to have arm64 libraries for both iPhoneOS and iPhoneSimulator.

The new scummvm-ios7-libs-v3 contains some new libraries compared to the v2-libs:

  • faad
  • gif
  • mpeg2
  • theoradec
  • vex

Update the instructions using the scummvm-ios7-libs-v3.

The scummvm-ios7-libs-v3 can be downloaded at https://github.com/larsamannen/scummvm-ios7-libs-v3/blob/main/scummvm-ios7-libs-v3.zip

Copy link
Member

@criezy criezy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes to create_project break the macOS build. So this needs to be fixed.

At this point I have no plan to switch to xcframeworks for macOS as the main way for developers to get their libs is through homebrew or macports. Also for the i386 and x86_64 targets I use old Xcode versions that contain the SDKs I target, and those do not support xcframeworks. So for macOS it still needs to use the static libraries.

I think that it could actually be a good idea for iOS to have a switch in create_project (for example --use-ios-static-libs so that those with older Xcode versions can still use the v2 package.

Another change that will be needed is to update the configure/make way to build scummvm so that it works with the xcframework when building for ios. From what I can see it should work with the new v3 package, but would need to add <libname>.xcframeworks/ios-arm64-armv7-armv7s/Headers/to the header path and <libname>.xcframeworks/ios-arm64-armv7-armv7s/ to the link path.
Actually, maybe the --use-ios-static-libs in create_project could also use the v3 package in the same way so that even old Xcode version can use the updated package?

@criezy
Copy link
Member

criezy commented Apr 1, 2023

I forgot to confirm that the change work well for me for iOS development on a M1 mac (both simulator and real device).

@larsamannen larsamannen force-pushed the ls_xcframeworks branch 3 times, most recently from fa933be to f89d856 Compare April 14, 2023 06:27
tag2015 and others added 2 commits April 18, 2023 22:06
The introduction of Apple M1 processor, which is based on the arm64
architecture, makes it impossible to use fat static libraries for iOS
and tvOS since building libraries for the simulators targeting the
arm64 architecture conflicts with the iOS and tvOS native arm64
libraries. It's not possible to have two arm64 libraries targeting
different platforms in the same fat library.

Apple resolves this problem with XCFrameworks. Each XCFramework
contain an Info.plist specifying which platforms and architectures it
targets.

The new iOS and tvOS library package, scummvm-ios7-libs-v3, utilize
the XCFramework format and includes pre-compiled libraries for both
iOS and tvOS with corresponding simulator.

Add the option to use XCFramework in create_project by passing the
switch '--use-xcframework'

Implement support to use XCFrameworks for iOS, tvOS and macOS. If not
passing '--use-xcframework' to create_project, legacy behaviour is
applied.

This commit also add support for mikmod for tvOS.
This updates the instructions for building the ios7 and tvos backends
using scummvm-ios7-libs-v3, utilizing the Apple XCFramework format for
the pre-compiled libraries.

Using scummvm-ios7-libs-v3 also enables use of the following
features:
 - faad
 - gif
 - mikmod
 - mpeg2
 - theoradec
 - vpx
Update ios7 runner to fetch the scummvm-ios-libs-v3 package which
includes precompiled libraries for iOS and tvOS as XCFrameworks.
@larsamannen
Copy link
Contributor Author

@criezy Updated according to comments. Ready to merge if everything looks ok!

Copy link
Member

@criezy criezy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I only made a minor suggestion for the documentation, but it otherwise looks good now.

mkdir build
Copy the contents of the ``scummvm-ios7-libs-v2`` folder you extracted earlier into the ``build`` directory, using either the Finder, or the command line as follows:
Move the contents of the ``scummvm-ios7-libs-v3`` folder you extracted earlier into the ``build`` directory, using either the Finder, or the command line as follows:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Move the contents of the ``scummvm-ios7-libs-v3`` folder you extracted earlier into the ``build`` directory, using either the Finder, or the command line as follows:
Move the ``frameworks`` folder you extracted earlier from the ``scummvm-ios7-libs-v3.zip`` file into the ``build`` directory, using either the Finder, or the command line as follows:

@larsamannen larsamannen merged commit e56960f into scummvm:master Apr 24, 2023
@larsamannen larsamannen deleted the ls_xcframeworks branch April 24, 2023 20:35
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.

3 participants