[Scummvm-git-logs] scummvm master -> e56960fe5d662ea55b34da8040b9ecbfab4be484

larsamannen noreply at scummvm.org
Mon Apr 24 20:35:00 UTC 2023


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a6fa65e87a CREATE_PROJECT: Add option to use XCFramework in iOS, tvOS and macOS
8583fb54a8 DOCPORTAL: Update ios7 and tvos instructions
e56960fe5d CI: Update Xcode ios7 runners to use scummvm-ios7-libs-v3


Commit: a6fa65e87abe9f5ccf9932ed1499d46859e832e0
    https://github.com/scummvm/scummvm/commit/a6fa65e87abe9f5ccf9932ed1499d46859e832e0
Author: Walter Agazzi (walter.agazzi at protonmail.com)
Date: 2023-04-24T22:34:55+02:00

Commit Message:
CREATE_PROJECT: Add option to use XCFramework in iOS, tvOS and macOS

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.

Changed paths:
    devtools/create_project/create_project.cpp
    devtools/create_project/create_project.h
    devtools/create_project/xcode.cpp
    devtools/create_project/xcode.h


diff --git a/devtools/create_project/create_project.cpp b/devtools/create_project/create_project.cpp
index 873c4e7eff6..6c1c285a9f6 100644
--- a/devtools/create_project/create_project.cpp
+++ b/devtools/create_project/create_project.cpp
@@ -303,6 +303,8 @@ int main(int argc, char *argv[]) {
 			setup.useWindowsUnicode = true;
 		} else if (!std::strcmp(argv[i], "--use-windows-ansi")) {
 			setup.useWindowsUnicode = false;
+		} else if (!std::strcmp(argv[i], "--use-xcframework")) {
+			setup.useXCFramework = true;
 		} else {
 			std::cerr << "ERROR: Unknown parameter \"" << argv[i] << "\"\n";
 			return -1;
diff --git a/devtools/create_project/create_project.h b/devtools/create_project/create_project.h
index b9cb082e30e..7f7582627bd 100644
--- a/devtools/create_project/create_project.h
+++ b/devtools/create_project/create_project.h
@@ -248,6 +248,7 @@ struct BuildSetup {
 	bool useCanonicalLibNames; ///< Whether to use canonical libraries names or default ones
 	bool useStaticDetection;   ///< Whether to link detection features inside the executable or not.
 	bool useWindowsUnicode;    ///< Whether to use Windows Unicode APIs or ANSI APIs.
+	bool useXCFramework;       ///< Whether to use Apple XCFrameworks instead of static libraries
 
 	BuildSetup() {
 		devTools = false;
@@ -258,6 +259,7 @@ struct BuildSetup {
 		useCanonicalLibNames = false;
 		useStaticDetection = true;
 		useWindowsUnicode = true;
+		useXCFramework = false;
 	}
 
 	bool featureEnabled(std::string feature) const;
diff --git a/devtools/create_project/xcode.cpp b/devtools/create_project/xcode.cpp
index 52f2c359cc2..f8fd7b35c25 100644
--- a/devtools/create_project/xcode.cpp
+++ b/devtools/create_project/xcode.cpp
@@ -434,6 +434,8 @@ void XcodeProvider::setupCopyFilesBuildPhase() {
 
 #define DEF_LOCALLIB_STATIC(lib) DEF_LOCALLIB_STATIC_PATH(lib ".a", lib, false)
 
+#define DEF_LOCALXCFRAMEWORK(xcframework,path) { properties[xcframework".xcframework"] = FileProperty("wrapper.xcframework", xcframework".xcframework", path + "/frameworks/" + xcframework ".xcframework", "\"<group>\""); \
+	ADD_SETTING_ORDER_NOVALUE(children, getHash(xcframework".xcframework"), xcframework".xcframework", fwOrder++); }
 
 /**
  * Sets up the frameworks build phase.
@@ -450,6 +452,13 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
 	children._hasOrder = true;
 	children._flags = kSettingsAsList;
 
+	std::string projectOutputDirectory;
+#ifdef POSIX
+	char tmpbuf[PATH_MAX];
+	char *rp = realpath(setup.outputDir.c_str(), tmpbuf);
+	projectOutputDirectory = rp;
+#endif
+
 	// Setup framework file properties
 	std::map<std::string, FileProperty> properties;
 	int fwOrder = 0;
@@ -478,9 +487,11 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
 	// Local libraries
 	if (CONTAINS_DEFINE(setup.defines, "USE_FAAD")) {
 		DEF_LOCALLIB_STATIC("libfaad");
+		DEF_LOCALXCFRAMEWORK("faad", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FLAC")) {
 		DEF_LOCALLIB_STATIC("libFLAC");
+		DEF_LOCALXCFRAMEWORK("FLAC", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FLUIDLITE")) {
 		DEF_LOCALLIB_STATIC("libfluidlite");
@@ -489,52 +500,71 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
 		DEF_LOCALLIB_STATIC("libffi");
 		DEF_LOCALLIB_STATIC("libglib-2.0");
 		DEF_SYSTBD("libffi");
+		DEF_LOCALXCFRAMEWORK("fluidsynth", projectOutputDirectory);
+		DEF_LOCALXCFRAMEWORK("ffi", projectOutputDirectory);
+		DEF_LOCALXCFRAMEWORK("intl", projectOutputDirectory);
+		DEF_LOCALXCFRAMEWORK("bz2", projectOutputDirectory);
+		DEF_LOCALXCFRAMEWORK("glib-2.0", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FREETYPE2")) {
 		DEF_LOCALLIB_STATIC("libfreetype");
+		DEF_LOCALXCFRAMEWORK("freetype", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_JPEG")) {
 		DEF_LOCALLIB_STATIC("libjpeg");
+		DEF_LOCALXCFRAMEWORK("jpeg", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_LIBCURL")) {
 		DEF_LOCALLIB_STATIC("libcurl");
+		DEF_LOCALXCFRAMEWORK("curl", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_MAD")) {
 		DEF_LOCALLIB_STATIC("libmad");
+		DEF_LOCALXCFRAMEWORK("mad", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_MIKMOD")) {
 		DEF_LOCALLIB_STATIC("libmikmod");
+		DEF_LOCALXCFRAMEWORK("mikmod", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_MPEG2")) {
 		DEF_LOCALLIB_STATIC("libmpeg2");
+		DEF_LOCALXCFRAMEWORK("mpeg2", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FRIBIDI")) {
 		DEF_LOCALLIB_STATIC("libfribidi");
+		DEF_LOCALXCFRAMEWORK("fribidi", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_PNG")) {
 		DEF_LOCALLIB_STATIC("libpng");
+		DEF_LOCALXCFRAMEWORK("png", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_GIF")) {
 		DEF_LOCALLIB_STATIC("libgif");
+		DEF_LOCALXCFRAMEWORK("gif", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_OGG")) {
 		DEF_LOCALLIB_STATIC("libogg");
+		DEF_LOCALXCFRAMEWORK("ogg", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_VORBIS")) {
 		DEF_LOCALLIB_STATIC("libvorbis");
 		DEF_LOCALLIB_STATIC("libvorbisfile");
+		DEF_LOCALXCFRAMEWORK("vorbis", projectOutputDirectory);
+		DEF_LOCALXCFRAMEWORK("vorbisfile", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_TREMOR")) {
 		DEF_LOCALLIB_STATIC("libvorbisidec");
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_THEORADEC")) {
 		DEF_LOCALLIB_STATIC("libtheoradec");
+		DEF_LOCALXCFRAMEWORK("theoradec", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_RETROWAVE")) {
 		DEF_LOCALLIB_STATIC("libretrowave");
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_VPX")) {
 		DEF_LOCALLIB_STATIC("libvpx");
+		DEF_LOCALXCFRAMEWORK("vpx", projectOutputDirectory);
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_ZLIB")) {
 		DEF_SYSTBD("libz");
@@ -548,6 +578,7 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
 		DEF_LOCALLIB_STATIC("libSDL2");
 		if (CONTAINS_DEFINE(setup.defines, "USE_SDL_NET")) {
 			DEF_LOCALLIB_STATIC("libSDL2_net");
+			DEF_LOCALXCFRAMEWORK("SDL2_net", projectOutputDirectory);
 		}
 	} else {
 		DEF_LOCALLIB_STATIC("libSDLmain");
@@ -592,56 +623,61 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
 	frameworks_iOS.push_back("Accelerate.framework");
 
 	if (CONTAINS_DEFINE(setup.defines, "USE_FAAD")) {
-		frameworks_iOS.push_back("libfaad.a");
+		frameworks_iOS.push_back(getLibString("faad", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FLAC")) {
-		frameworks_iOS.push_back("libFLAC.a");
+		frameworks_iOS.push_back(getLibString("FLAC", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FREETYPE2")) {
-		frameworks_iOS.push_back("libfreetype.a");
+		frameworks_iOS.push_back(getLibString("freetype", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_JPEG")) {
-		frameworks_iOS.push_back("libjpeg.a");
+		frameworks_iOS.push_back(getLibString("jpeg", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_PNG")) {
-		frameworks_iOS.push_back("libpng.a");
+		frameworks_iOS.push_back(getLibString("png", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_GIF")) {
-		frameworks_iOS.push_back("libgif.a");
+		frameworks_iOS.push_back(getLibString("gif", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_OGG")) {
-		frameworks_iOS.push_back("libogg.a");
+		frameworks_iOS.push_back(getLibString("ogg", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_VORBIS")) {
-		frameworks_iOS.push_back("libvorbis.a");
-		frameworks_iOS.push_back("libvorbisfile.a");
+		frameworks_iOS.push_back(getLibString("vorbis", setup.useXCFramework));
+		frameworks_iOS.push_back(getLibString("vorbisfile", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_TREMOR")) {
-		frameworks_iOS.push_back("libvorbisidec.a");
+		frameworks_iOS.push_back(getLibString("vorbisidec", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_THEORADEC")) {
-		frameworks_iOS.push_back("libtheoradec.a");
+		frameworks_iOS.push_back(getLibString("theoradec", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_VPX")) {
-		frameworks_iOS.push_back("libvpx.a");
+		frameworks_iOS.push_back(getLibString("vpx", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_MAD")) {
-		frameworks_iOS.push_back("libmad.a");
+		frameworks_iOS.push_back(getLibString("mad", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_MIKMOD")) {
-		frameworks_iOS.push_back("libmikmod.a");
+		frameworks_iOS.push_back(getLibString("mikmod", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_MPEG2")) {
-		frameworks_iOS.push_back("libmpeg2.a");
+		frameworks_iOS.push_back(getLibString("mpeg2", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FRIBIDI")) {
-		frameworks_iOS.push_back("libfribidi.a");
+		frameworks_iOS.push_back(getLibString("fribidi", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FLUIDSYNTH") &&
 		!CONTAINS_DEFINE(setup.defines, "USE_FLUIDLITE")) {
-		frameworks_iOS.push_back("libfluidsynth.a");
-		frameworks_iOS.push_back("libglib-2.0.a");
-		frameworks_iOS.push_back("libffi.a");
+		frameworks_iOS.push_back(getLibString("fluidsynth", setup.useXCFramework));
+		frameworks_iOS.push_back(getLibString("ffi", setup.useXCFramework));
+		frameworks_iOS.push_back(getLibString("glib-2.0", setup.useXCFramework));
+		if (setup.useXCFramework) {
+			// The libintl and libbz2 libs are not combined into glib-2.0 in the xcframework libs
+			frameworks_iOS.push_back(getLibString("intl", setup.useXCFramework));
+			frameworks_iOS.push_back(getLibString("bz2", setup.useXCFramework));
+		}
 		frameworks_iOS.push_back("CoreMIDI.framework");
 		frameworks_iOS.push_back("libiconv.tbd");
 	}
@@ -649,14 +685,15 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
 		frameworks_iOS.push_back("libz.tbd");
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_LIBCURL")) {
-		frameworks_iOS.push_back("libcurl.a");
+		frameworks_iOS.push_back(getLibString("curl", setup.useXCFramework));
 		frameworks_iOS.push_back("Security.framework");
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_SDL_NET")) {
-		if (setup.useSDL2)
-			frameworks_iOS.push_back("libSDL2_net.a");
-		else
-			frameworks_iOS.push_back("libSDL_net.a");
+		if (setup.useSDL2) {
+			frameworks_iOS.push_back(getLibString("SDL2_net", setup.useXCFramework));
+		} else {
+			frameworks_iOS.push_back(getLibString("SDL_net", setup.useXCFramework));
+		}
 	}
 
 	for (ValueList::iterator framework = frameworks_iOS.begin(); framework != frameworks_iOS.end(); framework++) {
@@ -699,80 +736,80 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
 	frameworks_osx.push_back("AudioUnit.framework");
 
 	if (CONTAINS_DEFINE(setup.defines, "USE_FAAD")) {
-		frameworks_osx.push_back("libfaad.a");
+		frameworks_osx.push_back(getLibString("faad", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FLAC")) {
-		frameworks_osx.push_back("libFLAC.a");
+		frameworks_osx.push_back(getLibString("FLAC", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FLUIDSYNTH") &&
 		!CONTAINS_DEFINE(setup.defines, "USE_FLUIDLITE")) {
-		frameworks_osx.push_back("libfluidsynth.a");
-		frameworks_osx.push_back("libglib-2.0.a");
+		frameworks_osx.push_back(getLibString("fluidsynth", setup.useXCFramework));
+		frameworks_osx.push_back(getLibString("glib-2.0", setup.useXCFramework));
 		frameworks_osx.push_back("libffi.tbd");
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FREETYPE2")) {
-		frameworks_osx.push_back("libfreetype.a");
+		frameworks_osx.push_back(getLibString("freetype", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_JPEG")) {
-		frameworks_osx.push_back("libjpeg.a");
+		frameworks_osx.push_back(getLibString("jpeg", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_LIBCURL")) {
-		frameworks_osx.push_back("libcurl.a");
+		frameworks_osx.push_back(getLibString("curl", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_MAD")) {
-		frameworks_osx.push_back("libmad.a");
+		frameworks_osx.push_back(getLibString("mad", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_MIKMOD")) {
 		frameworks_osx.push_back("libmikmod.a");
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_MPEG2")) {
-		frameworks_osx.push_back("libmpeg2.a");
+		frameworks_osx.push_back(getLibString("mpeg2", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FRIBIDI")) {
-		frameworks_osx.push_back("libfribidi.a");
+		frameworks_osx.push_back(getLibString("fribidi", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_PNG")) {
-		frameworks_osx.push_back("libpng.a");
+		frameworks_osx.push_back(getLibString("png", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_GIF")) {
-		frameworks_osx.push_back("libgif.a");
+		frameworks_osx.push_back(getLibString("gif", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_OGG")) {
-		frameworks_osx.push_back("libogg.a");
+		frameworks_osx.push_back(getLibString("ogg", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_VORBIS")) {
-		frameworks_osx.push_back("libvorbis.a");
-		frameworks_osx.push_back("libvorbisfile.a");
+		frameworks_osx.push_back(getLibString("vorbis", setup.useXCFramework));
+		frameworks_osx.push_back(getLibString("vorbisfile", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_TREMOR")) {
-		frameworks_osx.push_back("libvorbisidec.a");
+		frameworks_osx.push_back(getLibString("vorbisidec", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_THEORADEC")) {
-		frameworks_osx.push_back("libtheoradec.a");
+		frameworks_osx.push_back(getLibString("theoradec", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_RETROWAVE")) {
-		frameworks_osx.push_back("libretrowave.a");
+		frameworks_osx.push_back(getLibString("retrowave", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_VPX")) {
-		frameworks_osx.push_back("libvpx.a");
+		frameworks_osx.push_back(getLibString("vpx", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_ZLIB")) {
 		frameworks_osx.push_back("libz.tbd");
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_DISCORD")) {
-		frameworks_osx.push_back("libdiscord-rpc.a");
+		frameworks_osx.push_back(getLibString("discord-rpc", setup.useXCFramework));
 	}
 
 	if (setup.useSDL2) {
-		frameworks_osx.push_back("libSDL2main.a");
-		frameworks_osx.push_back("libSDL2.a");
+		frameworks_osx.push_back(getLibString("SDL2main", setup.useXCFramework));
+		frameworks_osx.push_back(getLibString("SDL2", setup.useXCFramework));
 		if (CONTAINS_DEFINE(setup.defines, "USE_SDL_NET"))
-			frameworks_osx.push_back("libSDL2_net.a");
+			frameworks_osx.push_back(getLibString("SDL2_net", setup.useXCFramework));
 	} else {
-		frameworks_osx.push_back("libSDLmain.a");
-		frameworks_osx.push_back("libSDL.a");
+		frameworks_osx.push_back(getLibString("SDLmain", setup.useXCFramework));
+		frameworks_osx.push_back(getLibString("SDL", setup.useXCFramework));
 		if (CONTAINS_DEFINE(setup.defines, "USE_SDL_NET"))
-			frameworks_osx.push_back("libSDL_net.a");
+			frameworks_osx.push_back(getLibString("SDL_net", setup.useXCFramework));
 	}
 
 	order = 0;
@@ -815,52 +852,58 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
 	frameworks_tvOS.push_back("Accelerate.framework");
 
 	if (CONTAINS_DEFINE(setup.defines, "USE_FAAD")) {
-		frameworks_tvOS.push_back("libfaad.a");
+		frameworks_tvOS.push_back(getLibString("faad", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FLAC")) {
-		frameworks_tvOS.push_back("libFLAC.a");
+		frameworks_tvOS.push_back(getLibString("FLAC", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FREETYPE2")) {
-		frameworks_tvOS.push_back("libfreetype.a");
-		frameworks_tvOS.push_back("libbz2.a");
+		frameworks_tvOS.push_back(getLibString("freetype", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_JPEG")) {
-		frameworks_tvOS.push_back("libjpeg.a");
+		frameworks_tvOS.push_back(getLibString("jpeg", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_PNG")) {
-		frameworks_tvOS.push_back("libpng.a");
+		frameworks_tvOS.push_back(getLibString("png", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_GIF")) {
-		frameworks_tvOS.push_back("libgif.a");
+		frameworks_tvOS.push_back(getLibString("gif", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_OGG")) {
-		frameworks_tvOS.push_back("libogg.a");
+		frameworks_tvOS.push_back(getLibString("ogg", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_VORBIS")) {
-		frameworks_tvOS.push_back("libvorbis.a");
-		frameworks_tvOS.push_back("libvorbisfile.a");
+		frameworks_tvOS.push_back(getLibString("vorbis", setup.useXCFramework));
+		frameworks_tvOS.push_back(getLibString("vorbisfile", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_TREMOR")) {
-		frameworks_tvOS.push_back("libvorbisidec.a");
+		frameworks_tvOS.push_back(getLibString("vorbisidec", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_THEORADEC")) {
-		frameworks_tvOS.push_back("libtheoradec.a");
+		frameworks_tvOS.push_back(getLibString("theoradec", setup.useXCFramework));
+	}
+	if (CONTAINS_DEFINE(setup.defines, "USE_VPX")) {
+		frameworks_tvOS.push_back(getLibString("vpx", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_MAD")) {
-		frameworks_tvOS.push_back("libmad.a");
+		frameworks_tvOS.push_back(getLibString("mad", setup.useXCFramework));
+	}
+	if (CONTAINS_DEFINE(setup.defines, "USE_MIKMOD")) {
+		frameworks_tvOS.push_back(getLibString("mikmod", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_MPEG2")) {
-		frameworks_tvOS.push_back("libmpeg2.a");
+		frameworks_tvOS.push_back(getLibString("mpeg2", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FRIBIDI")) {
-		frameworks_tvOS.push_back("libfribidi.a");
+		frameworks_tvOS.push_back(getLibString("fribidi", setup.useXCFramework));
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_FLUIDSYNTH") &&
 		!CONTAINS_DEFINE(setup.defines, "USE_FLUIDLITE")) {
-		frameworks_tvOS.push_back("libfluidsynth.a");
-		frameworks_tvOS.push_back("libglib-2.0.a");
-		frameworks_tvOS.push_back("libintl.a");
-		frameworks_tvOS.push_back("libffi.a");
+		frameworks_tvOS.push_back(getLibString("fluidsynth", setup.useXCFramework));
+		frameworks_tvOS.push_back(getLibString("ffi", setup.useXCFramework));
+		frameworks_tvOS.push_back(getLibString("glib-2.0", setup.useXCFramework));
+		frameworks_tvOS.push_back(getLibString("intl", setup.useXCFramework));
+		frameworks_tvOS.push_back(getLibString("bz2", setup.useXCFramework));
 		frameworks_tvOS.push_back("CoreMIDI.framework");
 		frameworks_tvOS.push_back("libiconv.tbd");
 	}
@@ -868,14 +911,15 @@ void XcodeProvider::setupFrameworksBuildPhase(const BuildSetup &setup) {
 		frameworks_tvOS.push_back("libz.tbd");
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_LIBCURL")) {
-		frameworks_tvOS.push_back("libcurl.a");
+		frameworks_tvOS.push_back(getLibString("curl", setup.useXCFramework));
 		frameworks_tvOS.push_back("Security.framework");
 	}
 	if (CONTAINS_DEFINE(setup.defines, "USE_SDL_NET")) {
-		if (setup.useSDL2)
-			frameworks_tvOS.push_back("libSDL2_net.a");
-		else
-			frameworks_tvOS.push_back("libSDL_net.a");
+		if (setup.useSDL2) {
+			frameworks_tvOS.push_back(getLibString("SDL2_net", setup.useXCFramework));
+		} else {
+			frameworks_tvOS.push_back(getLibString("SDL_net", setup.useXCFramework));
+		}
 	}
 
 	for (ValueList::iterator framework = frameworks_tvOS.begin(); framework != frameworks_tvOS.end(); framework++) {
@@ -1117,6 +1161,16 @@ XcodeProvider::ValueList& XcodeProvider::getResourceFiles(const BuildSetup &setu
 	return files;
 }
 
+std::string XcodeProvider::getLibString(std::string libName, bool xcframework) const {
+	std::string libString;
+	if (xcframework) {
+		libString = libName + std::string(".xcframework");
+	} else {
+		libString = std::string("lib") + libName + std::string(".a");
+	}
+	return libString;
+}
+
 void XcodeProvider::setupResourcesBuildPhase(const BuildSetup &setup) {
 	_resourcesBuildPhase._comment = "PBXResourcesBuildPhase";
 
@@ -1315,12 +1369,14 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
 	for (StringList::const_iterator i = setup.includeDirs.begin(); i != setup.includeDirs.end(); ++i)
 		iPhone_HeaderSearchPaths.push_back("\"" + *i + "\"");
 	iPhone_HeaderSearchPaths.push_back("\"" + projectOutputDirectory + "\"");
-	iPhone_HeaderSearchPaths.push_back("\"" + projectOutputDirectory + "/include\"");
-	if (CONTAINS_DEFINE(setup.defines, "USE_SDL_NET")) {
-		if (setup.useSDL2)
-			iPhone_HeaderSearchPaths.push_back("\"" + projectOutputDirectory + "/include/SDL2\"");
-		else
-			iPhone_HeaderSearchPaths.push_back("\"" + projectOutputDirectory + "include/SDL\"");
+	if (!setup.useXCFramework) {
+		iPhone_HeaderSearchPaths.push_back("\"" + projectOutputDirectory + "/include\"");
+		if (CONTAINS_DEFINE(setup.defines, "USE_SDL_NET")) {
+			if (setup.useSDL2)
+				iPhone_HeaderSearchPaths.push_back("\"" + projectOutputDirectory + "/include/SDL2\"");
+			else
+				iPhone_HeaderSearchPaths.push_back("\"" + projectOutputDirectory + "include/SDL\"");
+		}
 	}
 	ADD_SETTING_LIST(iPhone_Debug, "HEADER_SEARCH_PATHS", iPhone_HeaderSearchPaths, kSettingsAsList | kSettingsQuoteVariable, 5);
 	ADD_SETTING_QUOTE(iPhone_Debug, "INFOPLIST_FILE", "$(SRCROOT)/dists/ios7/Info.plist");
@@ -1328,7 +1384,8 @@ void XcodeProvider::setupBuildConfiguration(const BuildSetup &setup) {
 	for (StringList::const_iterator i = setup.libraryDirs.begin(); i != setup.libraryDirs.end(); ++i)
 		iPhone_LibPaths.push_back("\"" + *i + "\"");
 	iPhone_LibPaths.push_back("$(inherited)");
-	iPhone_LibPaths.push_back("\"" + projectOutputDirectory + "/lib\"");
+	if (!setup.useXCFramework)
+		iPhone_LibPaths.push_back("\"" + projectOutputDirectory + "/lib\"");
 	ADD_SETTING_LIST(iPhone_Debug, "LIBRARY_SEARCH_PATHS", iPhone_LibPaths, kSettingsAsList, 5);
 	ADD_SETTING(iPhone_Debug, "ONLY_ACTIVE_ARCH", "YES");
 	ADD_SETTING(iPhone_Debug, "PRODUCT_NAME", PROJECT_NAME);
diff --git a/devtools/create_project/xcode.h b/devtools/create_project/xcode.h
index 9429274e418..939c14c831e 100644
--- a/devtools/create_project/xcode.h
+++ b/devtools/create_project/xcode.h
@@ -325,6 +325,7 @@ private:
 
 	// Retrieve information
 	ValueList& getResourceFiles(const BuildSetup &setup) const;
+	std::string getLibString(std::string libName, bool xcframework) const;
 
 	// Hash generation
 	std::string getHash(std::string key);


Commit: 8583fb54a8dcb82fcfccfc2900a5f34b75d3e804
    https://github.com/scummvm/scummvm/commit/8583fb54a8dcb82fcfccfc2900a5f34b75d3e804
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2023-04-24T22:34:55+02:00

Commit Message:
DOCPORTAL: Update ios7 and tvos instructions

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

Changed paths:
    doc/docportal/other_platforms/ios.rst
    doc/docportal/other_platforms/tvos.rst


diff --git a/doc/docportal/other_platforms/ios.rst b/doc/docportal/other_platforms/ios.rst
index 24909179dd2..ca860290a3f 100644
--- a/doc/docportal/other_platforms/ios.rst
+++ b/doc/docportal/other_platforms/ios.rst
@@ -20,7 +20,7 @@ What you'll need
 
 - A Mac computer with Xcode installed. Xcode is a free App, available from the Mac App Store.
 - An Apple Developer account. You can sign up for a free account on the `Apple Developer Member Center <https://developer.apple.com/membercenter/>`_ with your Apple ID.
-- The ScummVM `iOS Libraries <https://downloads.scummvm.org/frs/build/scummvm-ios7-libs-v2.zip>`_ downloaded, and the zip file extracted.
+- The ScummVM `iOS Libraries <https://downloads.scummvm.org/frs/build/scummvm-ios7-libs-v3.zip>`_ downloaded, and the zip file extracted.
 
 .. note::
 
@@ -47,11 +47,11 @@ Create a new directory called ``build`` at the same level as the repository you
 
     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:
 
 .. code-block::
 
-    cp -r ~/Downloads/scummvm-ios7-libs-v2/* ~/build/
+    mv ~/Downloads/frameworks ~/build/
 
 If your downloaded iOS library folder is not in the Downloads folder as it is in the preceding example, change the path to where the folder actually is.
 
@@ -76,7 +76,7 @@ It's time to generate the Xcode project. Run the following on the command line:
 
 .. code::
 
-    ../scummvm/devtools/create_project/xcode/build/Release/create_project ../scummvm --xcode --enable-fluidsynth --disable-nasm --disable-opengl --disable-theoradec --disable-mpeg2 --disable-taskbar --disable-tts --disable-fribidi
+    ../scummvm/devtools/create_project/xcode/build/Release/create_project ../scummvm --xcode --use-xcframework --enable-faad --enable-fluidsynth --enable-gif --enable-mikmod --enable-mpeg2 --enable-vpx --disable-nasm --disable-opengl --disable-taskbar --disable-tts
 
 The resulting directory structure looks like this:
 
@@ -85,8 +85,7 @@ The resulting directory structure looks like this:
     Home
      |--scummvm
      '--build
-         |-- include
-         |-- lib
+         |-- frameworks
          |-- engines
          '-- scummvm.xcodeproj
 
diff --git a/doc/docportal/other_platforms/tvos.rst b/doc/docportal/other_platforms/tvos.rst
index 5fdab31bf81..35655153a53 100644
--- a/doc/docportal/other_platforms/tvos.rst
+++ b/doc/docportal/other_platforms/tvos.rst
@@ -17,7 +17,7 @@ There are two ways to install ScummVM on an Apple TV depending on if building th
 Building the project
 ************************************
 
-Since the port for Apple TV shares the same code base as the iOS port the instructions for building the project is the same as for iOS. Follow the :doc:`./ios` with the differences that the `tvOS libraries <https://github.com/larsamannen/scummvm-tvos-libs-v1>`_ should be used instead and the ``ScummVM-tvOS`` target should be chosen in Xcode. Use the libraries in the ``appletv`` folder if building for real target and ``appletvsimulator`` if building for simulator. Note that the libraries are built without bitcode since it's not required since tvOS 16.
+Since the port for Apple TV shares the same code base as the iOS port the instructions for building the project is the same as for iOS. Follow the :doc:`./ios` with the difference that the ``ScummVM-tvOS`` target should be chosen in Xcode.
 
 Downloading and installing ScummVM
 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


Commit: e56960fe5d662ea55b34da8040b9ecbfab4be484
    https://github.com/scummvm/scummvm/commit/e56960fe5d662ea55b34da8040b9ecbfab4be484
Author: Lars Sundström (l.sundstrom at gmail.com)
Date: 2023-04-24T22:34:55+02:00

Commit Message:
CI: Update Xcode ios7 runners to use scummvm-ios7-libs-v3

Update ios7 runner to fetch the scummvm-ios-libs-v3 package which
includes precompiled libraries for iOS and tvOS as XCFrameworks.

Changed paths:
    .github/workflows/ci.yml


diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0a655656348..f0708539dfe 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -111,8 +111,8 @@ jobs:
             brewPackages: a52dec faad2 flac fluid-synth freetype fribidi giflib jpeg mad libmikmod libmpeg2 libogg libpng libvorbis libvpx sdl2 sdl2_net theora
           - platform: ios7
             buildFlags: -scheme ScummVM-iOS CODE_SIGN_IDENTITY="" CODE_SIGNING_ALLOWED=NO
-            configFlags: --disable-nasm --disable-opengl --disable-theoradec --disable-mpeg2 --disable-taskbar --disable-tts --disable-fribidi
-            packagesUrl: https://downloads.scummvm.org/frs/build/scummvm-ios7-libs-v2.zip
+            configFlags: --use-xcframework --enable-faad --enable-gif --enable-mikmod --enable-mpeg2 --enable-vpx --disable-nasm --disable-opengl --disable-taskbar --disable-tts
+            packagesUrl: https://downloads.scummvm.org/frs/build/scummvm-ios7-libs-v3.zip
     env:
       BUILDCACHE_MAX_CACHE_SIZE: 2000000000
       BUILDCACHE_HARD_LINKS: true




More information about the Scummvm-git-logs mailing list