Difference between revisions of "Compiling ScummVM/macOS"

From ScummVM :: Wiki
Jump to navigation Jump to search
(→‎Manual compilation: added libvpx and libmikmod links)
 
(41 intermediate revisions by 7 users not shown)
Line 1: Line 1:
== Compiling ScummVM under OS X ==
This page explains how to compile your own version of [[ScummVM]] for [[macOS]]. See also [[Compiling ScummVM/iPhone]] for iOS based devices.


Compiling ScummVM under OS X requires setting up the build environment first, and then compiling the sources either via command line, or the XCode GUI
== Compiling ScummVM under macOS ==
 
Compiling ScummVM under macOS requires setting up the build environment first, and then compiling the sources either via command line, or the Xcode GUI.


== Things needed ==
== Things needed ==


=== XCode ===
=== 1. Xcode ===
This can be installed from the Apple Store
This can be installed from the [https://itunes.apple.com/us/app/xcode/id497799835?mt=12 Mac App Store].


=== XCode command line tools ===
=== 2. Xcode command line tools ===
After installing XCode, open a terminal and type
After installing Xcode, open a terminal and type:
<source lang="bash">
 
<syntaxhighlight lang="bash">
xcode-select --install
xcode-select --install
</source>
</syntaxhighlight>


=== Package manager ===
=== 3. Package manager ===
Getting the required libraries is easier with a package manager. The three most well-known ones are [https://www.macports.org/ MacPorts], [http://brew.sh/ Homebrew] and [http://www.finkproject.org/ Fink].
Getting the required libraries is easier with a package manager. The three most well-known ones are [http://brew.sh/ Homebrew], [https://www.macports.org/ MacPorts], and [http://www.finkproject.org/ Fink].


==== 1. MacPorts ====
==== Homebrew (recommended) ====
Get the MacPorts installer for your OS X version from the [https://www.macports.org/install.php MacPorts installation page]
Install Homebrew by pasting the following into a terminal:


==== 2. Homebrew ====
<syntaxhighlight lang="bash">
You can install homebrew by pasting the following into a terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
<source lang="bash">
</syntaxhighlight>
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
</source>


==== 3. Fink ====
==== MacPorts ====
You can install Fink by downloading and building the source from the [http://www.finkproject.org/download/srcdist.php Fink Source Release] page
Install MacPorts by downloading and running the installer from the [https://www.macports.org/install.php MacPorts installation page].


== Obtaining the required libraries ==
== Obtaining the required libraries ==
After downloading the XCode command line tools and a package manager, enter the following command to install all the required libraries:
If you only want to build scummvm for your own use and are fine executing it from the command line, you can use a package manager ([[#Homebrew|method 1]] and [[#MacPorts_2|2 below]]) to get the required libraries. However those methods to not provide the static libraries needed to build a ScummVM.app bundle. If your goal is to build such a bundle you will need to download our libs package ([[#Download our libs package|method 3]]) or compile the libraries manually ([[#Manual compilation|method 4]]).
 
=== Homebrew ===
After downloading the Xcode command line tools and installing Homebrew, enter the following command to install all the required libraries:
<syntaxhighlight lang="bash">
brew install a52dec faad2 flac fluid-synth freetype fribidi mad libmpeg2 libogg libpng libvorbis sdl2 sdl2_net theora giflib zlib jpeg-turbo curl pkg-config pandoc libvpx libmikmod
</syntaxhighlight>
 
=== MacPorts ===
After downloading the Xcode command line tools and installing MacPorts, enter the following command to install all the required libraries:
<syntaxhighlight lang="bash">
sudo port install libsdl2 libsdl2_net libjpeg-turbo libmpeg2 libogg libvorbis flac libmad libpng libtheora faad2 a52dec freetype zlib fluidsynth fribidi pandoc
</syntaxhighlight>


=== 1. MacPorts ===
=== Download our libs package ===
<source lang="bash">
* For Intel 32 bits (targets Mac OS X 10.6 or above): [https://downloads.scummvm.org/frs/build/scummvm-macosx-libs-i386.zip scummvm-macosx-libs-i386.zip]
sudo port install libsdl libjpeg-turbo libmpeg2 libogg libvorbis flac libmad libpng libtheora faad2 freetype zlib fluidsynth
* For Intel 64 bits (targets Mac OS X 10.9 or above): [https://downloads.scummvm.org/frs/build/scummvm-macosx-libs-x86_64.zip scummvm-macosx-libs-x86_64.zip]
</source>
* For Apple Silicon (targets macOS 11.0 or above): [https://downloads.scummvm.org/frs/build/scummvm-macosx-libs-arm64.zip scummvm-macosx-libs-arm64.zip]


=== 2. Homebrew ===
Those packages are configured to be placed in /usr/local/. So you should for example have the following structure:
<source lang="bash">
<pre>
brew install sdl jpeg-turbo libmpeg2 libogg libvorbis flac libmad libpng theora faad2 freetype lzlib fluid-synth
/usr/local/bin
</source>
/usr/local/include
/usr/local/lib
/usr/local/share
</pre>


=== 3. Fink ===
They also contain a relocate.sh script, which you can use if you place the package content in any other location.
<source lang="bash">
<syntaxhighlight lang="bash">
TODO
./relocate.sh --from /usr/local --to /Users/FooBar/Documents/scummvm-libs
</source>
</syntaxhighlight>
The script should be able to automatically determine the ''from'' and ''to'' paths, so they can be omitted in most cases.


=== 4. Manual compilation ===
If you place the content of the packages to a place other than /usr/local, you will need to specify the path to the libraries when you call '''configure''':
<syntaxhighlight lang="bash">
./configure --with-staticlib-prefix=/path/to/libs
</syntaxhighlight>
 
=== Manual compilation ===
Get the source code from the libraries. With this method you will not only need to get the libraries ScummVM uses directly, but also those they depend on.
Get the source code from the libraries. With this method you will not only need to get the libraries ScummVM uses directly, but also those they depend on.
* Required:
* Required:
** [https://www.libsdl.org SDL 1.2 or SDL 2]
** [https://www.libsdl.org SDL 2 or 1.2] (prefer SDL 2 unless you are on a very old version of MacOS X)
*Optional:
*Optional:
** [http://zlib.net zlib]
** [http://zlib.net zlib]
** [http://www.ijg.org/ jpeg]
** [http://www.ijg.org/ jpeg]
** [http://www.libpng.org/pub/png/libpng.html libpng]
** [http://www.libpng.org/pub/png/libpng.html libpng]
** [http://giflib.sourceforge.net giflib] Use giflib 5.1.4 as versions 5.1.5 to 5.2.1 (the latest as of this note) do not compile on macOS. Alternatively see the patch in https://sourceforge.net/p/giflib/bugs/133/).
** [http://www.xiph.org/vorbis/ libogg and libvorbis]
** [http://www.xiph.org/vorbis/ libogg and libvorbis]
** [http://www.xiph.org/flac FLAC]
** [http://www.xiph.org/flac FLAC]
** [http://www.underbit.com/products/mad/ libmad]
** [http://www.underbit.com/products/mad/ libmad]
** [http://libmpeg2.sourceforge.net mpeg2]
** [http://libmpeg2.sourceforge.net mpeg2]
** [http://www.audiocoding.com/faad2.html FAAD2]  
** [https://github.com/knik0/faad2 FAAD2]
** [http://liba52.sourceforge.net liba52]
** [https://theora.org Theora]
** [https://theora.org Theora]
** [https://github.com/webmproject/libvpx libvpx]
** [https://mikmod.sourceforge.net/ libmikmod]
** For cloud support:
*** [https://www.libsdl.org/projects/SDL_net/ SDL_net 2] or [https://www.libsdl.org/projects/SDL_net/release-1.2.html 1.2] (use same version as SDL)
*** [https://curl.haxx.se/ libcurl]
** For Freetype
** For Freetype
*** [http://www.bzip.org bzip2]
*** [http://www.bzip.org bzip2]
Line 70: Line 99:
*** [https://git.gnome.org/browse/glib glib]
*** [https://git.gnome.org/browse/glib glib]
*** [http://www.fluidsynth.org FluidSynth]
*** [http://www.fluidsynth.org FluidSynth]
** For FriBiDi
*** [https://www.gnu.org/software/autoconf/autoconf.html Autoconf]
*** [https://www.gnu.org/software/automake/ Automake]
*** [https://www.gnu.org/software/libtool/ Libtool]
*** [https://github.com/fribidi/fribidi FriBiDi]


All the libraries are compiled and installed in the same way:
All the libraries are compiled and installed in the same way:
<source lang="bash">
<syntaxhighlight lang="bash">
cd thelib-src
cd thelib-src
./configure --prefix=/path/to/install
./configure --prefix=/path/to/install
make
make
make install
make install
</source>
</syntaxhighlight>


The default installation path is /usr/local, but you will need admin privileges to install the libraries in this location.
The default installation path is /usr/local, but you will need admin privileges to install the libraries in this location.
<source lang="bash">
<syntaxhighlight lang="bash">
cd thelib-src
cd thelib-src
./configure
./configure
make
make
sudo make install
sudo make install
</source>
</syntaxhighlight>


If you want your compilation to be compatible with older system, use the -mmacosx-version-min flag (for example -mmacosx-version-min=10.5). To force compilation in 32 bits use -arch i386. You can do that by setting environment variables before compiling all the libraries and ScummVM:
If you want your compilation to be compatible with older systems, use the -mmacosx-version-min flag (for example -mmacosx-version-min=10.5). To force compilation in 32 bits use -arch i386. You can do that by setting environment variables before compiling all the libraries and ScummVM:
<source lang="bash">
<syntaxhighlight lang="bash">
export LDFLAGS="-arch i386 -mmacosx-version-min=10.5"
export LDFLAGS="-arch i386 -mmacosx-version-min=10.5"
export CFLAGS="-arch i386 -mmacosx-version-min=10.5"
export CFLAGS="-arch i386 -mmacosx-version-min=10.5"
export CXXFLAGS="-arch i386 -mmacosx-version-min=10.5"
export CXXFLAGS="-arch i386 -mmacosx-version-min=10.5"
</source>
</syntaxhighlight>


bzip2 is an exception. There is no configure and you directly call make with options. For example:
bzip2 is an exception. There is no configure and you directly call make with options. For example:
<source lang="bash">
<syntaxhighlight lang="bash">
make CFLAGS="-arch i386 -mmacosx-version-min=10.5 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64" LDFLAGS="-arch i386 -mmacosx-version-min=10.5"
make CFLAGS="-arch i386 -mmacosx-version-min=10.5 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64" LDFLAGS="-arch i386 -mmacosx-version-min=10.5"
make install PREFIX=/Users/criezy/Dev/scummvm-releases/libs
make install PREFIX=/Users/criezy/Dev/scummvm-releases/libs
</source>
</syntaxhighlight>


If you plan to build the ScummVM app bundle, you will need to generate static libraries. For most of the libraries this is done by default, but for a few you need to specify you want static libraries when invoking configure. Here are suggested configure options for each library. If the library is not listed in the table below this means the default is fine.
If you plan to build the ScummVM app bundle, you will need to generate static libraries. For most of the libraries this is done by default, but for a few you need to specify you want static libraries when invoking configure. Here are suggested configure options for each library. If the library is not listed in the table below this means the default is fine.
Line 113: Line 147:
|- style="background-color: #fafafa;"
|- style="background-color: #fafafa;"
| align=center valign=top| FLAC || --enable-static --disable-asm-optimizations ||
| align=center valign=top| FLAC || --enable-static --disable-asm-optimizations ||
|- style="background-color: #fafafa;"
| align=center valign=top| FriBiDi || --enable-static ||
|- style="background-color: #fafafa;"
|- style="background-color: #fafafa;"
| align=center valign=top| Theora || --disable-examples ||
| align=center valign=top| Theora || --disable-examples ||
Line 123: Line 159:
=== Configuring ScummVM ===
=== Configuring ScummVM ===
Run the configure script:
Run the configure script:
<source lang="bash">
<syntaxhighlight lang="bash">
./configure
./configure
</source>
</syntaxhighlight>


If no errors come up, you should be ready to compile ScummvM.
If no errors come up, you should be ready to compile ScummvM.
For a list of optional features (eg additional, not yet enabled engines) run:
For a list of optional features (e.g. additional, not yet enabled engines) run:
<source lang="bash">
<syntaxhighlight lang="bash">
./configure --help
./configure --help
</source>
</syntaxhighlight>


Here is a list of some options you may want to use:
Here is a list of some options you may want to use:
* '''--enable-all-engines''' or '''--enable-engine=foo,bar''' to enable unsupported engines (not compiled by default)
* '''--enable-all-engines''' or '''--enable-engine=foo,bar''' to enable unsupported engines (not compiled by default)
* '''--with-staticlib=/path/to/install/dir''' if your libraries are not in a standard place (e.g. you compiled the libraries manually with a custom installation directory). This is only used when building the application bundle.
* '''--with-staticlib-prefix=/path/to/install/dir''' if your libraries are not in a standard place (e.g. you compiled the libraries manually with a custom installation directory). This is only used when building the application bundle.
* '''--enable-updates --with-sparkle-prefix=/path/to/sparkle''' to enable Sparkle (disabled by default). The path should be the path to the directory that contains the Sparkle.framework and not the path to the Sparkle.framework itself.
* '''--enable-updates --with-sparkle-prefix=/path/to/sparkle''' to enable Sparkle (disabled by default). The path should be the path to the directory that contains the Sparkle.framework and not the path to the Sparkle.framework itself.


Line 141: Line 177:


=== Compiling ScummVM ===
=== Compiling ScummVM ===
Just run make (with -j to compile several files in parallel). For example
Just run make (with -j to compile several files in parallel, usually number of your virtual CPUs+2). For example, for a 2 core CPU:
<source lang="bash">
<syntaxhighlight lang="bash">
make -j4
make -j4
</source>
</syntaxhighlight>
 
or -j18 for a 16-core CPU (including hyperthreaded cores).


To recompile everything and not just the modified files:
To recompile everything and not just the modified files:
<source lang="bash">
<syntaxhighlight lang="bash">
make clean
make clean
make -j4
make -j4
</source>
</syntaxhighlight>


=== Installing ScummVM ===
=== Installing ScummVM ===
You can run ScummVM from the command line in the build directory:
You can run ScummVM from the command line in the build directory:
<source lang="bash">
<syntaxhighlight lang="bash">
./scummvm
./scummvm
</source>
</syntaxhighlight>


You can also generate an application bundle and move this one anywhere you want:
You can also generate an application bundle and move this one anywhere you want:
<source lang="bash">
<syntaxhighlight lang="bash">
make bundle
make bundle
</source>
</syntaxhighlight>


Some features such as dock integration are only available if you build the bundle.
Some features such as dock integration are only available if you build the bundle.


== Compiling ScummVM via the XCode GUI ==
Also if you run scummvm from the command line, you will need to set the Theme path in the ScummVM options so that it finds the modern theme. The themes are in gui/themes/ in the source code repository.
 
==== Important note about SDL2 ====
The scummvm compilation assumes that the bundle uses the static SDL library. However if you have both a dynamic and static SDL2 library, SDL2 by default will instruct to use the dynamic library. To make bundles that work on other computers you can do one of two things:
# Locate the installed sdl2-config script (for example ''/usr/local/bin/sdl2-config'') and edit the line after <code>--static-libs)</code>, replace <code>echo -L${exec_prefix}/lib -lSDL2</code> with <code>echo ${exec_prefix}/lib/libSDL2.a</code> (and preserve the rest of the line). This needs to be done before you make the bundle.
# After creating the bundle, copy the dynamic libSDL2 to the bundle and instruct the executable where to find it:
<syntaxhighlight lang="bash">
otool -L ScummVM.app/Contents/MacOS/scummvm  | grep SDL2
  <Note the path for the SDL2 library - below we assume it is /usr/local/lib/libSDL2-2.0.0.dylib>
mkdir ScummVM.app/Contents/Frameworks/
cp /usr/local/lib/libSDL2-2.0.0.dylib ScummVM.app/Contents/Frameworks/
install_name_tool -change /usr/local/lib/libSDL2-2.0.0.dylib "@executable_path/../Frameworks/libSDL2-2.0.0.dylib"  ScummVM.app/Contents/MacOS/scummvm
</syntaxhighlight>
 
Doing that is not needed if you are only going to use the ScummVM application on the same computer you compiled it on.
 
== Compiling ScummVM via the Xcode GUI ==
 
=== Creating an Xcode project ===
* Compile '''create_project''':
<syntaxhighlight lang="bash">
cd devtools/create_project/xcode
xcodebuild
</syntaxhighlight>
* Run create_project '''from the root ScummVM directory''':
<syntaxhighlight lang="bash">
cd ../../..
./devtools/create_project/xcode/build/Release/create_project . --xcode
</syntaxhighlight>


=== Creating an XCode project ===
Note that `create_project` accepts most of the same flags that `configure` accepts.
* Compile '''create_project''' inside devtools/create_project
* Copy the generated create_project tool in the ScummVM root folder
* Run the following:
<source lang="bash">
./create_project . --xcode --build-events --disable-nasm
</source>


=== Build the XCode project ===
=== Build the Xcode project ===
* Open and build the XCode project
* Open the Xcode project
* Note that you may need to change the project architecture. Click on the ScummVM project, and change "Architectures" to "64-bit Intel (x86_64)"
* Go to Product -> Scheme and set the scheme to "ScummVM-macOS"  
* If you're using XCode 5 or newer, you will also need to go to Product -> Scheme -> Edit Scheme -> Run tab -> Options tab and uncheck "Allow debugging when using document Versions Browser", otherwise the invalid "nsdocumentrevisionsdebugmode" option will be passed to the ScummVM executable by XCode
* Go to Product -> Scheme -> Edit Scheme -> Run tab -> Options tab and uncheck "Allow debugging when using document Versions Browser"
* If the required libraries (such as SDL2) are not in ''/usr/local'', you will need to update the ''Header Search Paths'' and ''Library Search Paths'' build settings in Xcode.
* Build with Product -> Build or Product -> Run


== Further reading ==
== Further reading ==
* [https://github.com/scummvm/scummvm/blob/master/README#L2416 ScummVM README, Section 9.0]
* [https://github.com/scummvm/scummvm/blob/master/README.md#100-compiling ScummVM README, Section 10.0]

Latest revision as of 11:34, 19 December 2023

This page explains how to compile your own version of ScummVM for macOS. See also Compiling ScummVM/iPhone for iOS based devices.

Compiling ScummVM under macOS

Compiling ScummVM under macOS requires setting up the build environment first, and then compiling the sources either via command line, or the Xcode GUI.

Things needed

1. Xcode

This can be installed from the Mac App Store.

2. Xcode command line tools

After installing Xcode, open a terminal and type:

xcode-select --install

3. Package manager

Getting the required libraries is easier with a package manager. The three most well-known ones are Homebrew, MacPorts, and Fink.

Homebrew (recommended)

Install Homebrew by pasting the following into a terminal:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

MacPorts

Install MacPorts by downloading and running the installer from the MacPorts installation page.

Obtaining the required libraries

If you only want to build scummvm for your own use and are fine executing it from the command line, you can use a package manager (method 1 and 2 below) to get the required libraries. However those methods to not provide the static libraries needed to build a ScummVM.app bundle. If your goal is to build such a bundle you will need to download our libs package (method 3) or compile the libraries manually (method 4).

Homebrew

After downloading the Xcode command line tools and installing Homebrew, enter the following command to install all the required libraries:

brew install a52dec faad2 flac fluid-synth freetype fribidi mad libmpeg2 libogg libpng libvorbis sdl2 sdl2_net theora giflib zlib jpeg-turbo curl pkg-config pandoc libvpx libmikmod

MacPorts

After downloading the Xcode command line tools and installing MacPorts, enter the following command to install all the required libraries:

sudo port install libsdl2 libsdl2_net libjpeg-turbo libmpeg2 libogg libvorbis flac libmad libpng libtheora faad2 a52dec freetype zlib fluidsynth fribidi pandoc

Download our libs package

Those packages are configured to be placed in /usr/local/. So you should for example have the following structure:

/usr/local/bin
/usr/local/include
/usr/local/lib
/usr/local/share

They also contain a relocate.sh script, which you can use if you place the package content in any other location.

./relocate.sh --from /usr/local --to /Users/FooBar/Documents/scummvm-libs

The script should be able to automatically determine the from and to paths, so they can be omitted in most cases.

If you place the content of the packages to a place other than /usr/local, you will need to specify the path to the libraries when you call configure:

./configure --with-staticlib-prefix=/path/to/libs

Manual compilation

Get the source code from the libraries. With this method you will not only need to get the libraries ScummVM uses directly, but also those they depend on.

All the libraries are compiled and installed in the same way:

cd thelib-src
./configure --prefix=/path/to/install
make
make install

The default installation path is /usr/local, but you will need admin privileges to install the libraries in this location.

cd thelib-src
./configure
make
sudo make install

If you want your compilation to be compatible with older systems, use the -mmacosx-version-min flag (for example -mmacosx-version-min=10.5). To force compilation in 32 bits use -arch i386. You can do that by setting environment variables before compiling all the libraries and ScummVM:

export LDFLAGS="-arch i386 -mmacosx-version-min=10.5"
export CFLAGS="-arch i386 -mmacosx-version-min=10.5"
export CXXFLAGS="-arch i386 -mmacosx-version-min=10.5"

bzip2 is an exception. There is no configure and you directly call make with options. For example:

make CFLAGS="-arch i386 -mmacosx-version-min=10.5 -Wall -Winline -O2 -g -D_FILE_OFFSET_BITS=64" LDFLAGS="-arch i386 -mmacosx-version-min=10.5"
make install PREFIX=/Users/criezy/Dev/scummvm-releases/libs

If you plan to build the ScummVM app bundle, you will need to generate static libraries. For most of the libraries this is done by default, but for a few you need to specify you want static libraries when invoking configure. Here are suggested configure options for each library. If the library is not listed in the table below this means the default is fine.

Library configure flags Comments
pkg-config --with-internal-glib
glib --enable-static
libmpeg2 --disable-sdl

Need to add -std=gnu89 to CFLAGS (for example 'export CFLAGS="-std=gnu89"' before invoking configure)

FLAC --enable-static --disable-asm-optimizations
FriBiDi --enable-static
Theora --disable-examples
  • Need to edit configure before running it to remove flag -fforce-addr
  • Examples do not compile with libpng 1.6

Compiling ScummVM via the command line

Configuring ScummVM

Run the configure script:

./configure

If no errors come up, you should be ready to compile ScummvM. For a list of optional features (e.g. additional, not yet enabled engines) run:

./configure --help

Here is a list of some options you may want to use:

  • --enable-all-engines or --enable-engine=foo,bar to enable unsupported engines (not compiled by default)
  • --with-staticlib-prefix=/path/to/install/dir if your libraries are not in a standard place (e.g. you compiled the libraries manually with a custom installation directory). This is only used when building the application bundle.
  • --enable-updates --with-sparkle-prefix=/path/to/sparkle to enable Sparkle (disabled by default). The path should be the path to the directory that contains the Sparkle.framework and not the path to the Sparkle.framework itself.

Note: If you want to use Sparkle, there are some additional steps to do such as setting up DSA signatures. See [1] for details. ScummVM expects to find the DSA public key in dist/macosx.dsa_pub.pem.

Compiling ScummVM

Just run make (with -j to compile several files in parallel, usually number of your virtual CPUs+2). For example, for a 2 core CPU:

make -j4

or -j18 for a 16-core CPU (including hyperthreaded cores).

To recompile everything and not just the modified files:

make clean
make -j4

Installing ScummVM

You can run ScummVM from the command line in the build directory:

./scummvm

You can also generate an application bundle and move this one anywhere you want:

make bundle

Some features such as dock integration are only available if you build the bundle.

Also if you run scummvm from the command line, you will need to set the Theme path in the ScummVM options so that it finds the modern theme. The themes are in gui/themes/ in the source code repository.

Important note about SDL2

The scummvm compilation assumes that the bundle uses the static SDL library. However if you have both a dynamic and static SDL2 library, SDL2 by default will instruct to use the dynamic library. To make bundles that work on other computers you can do one of two things:

  1. Locate the installed sdl2-config script (for example /usr/local/bin/sdl2-config) and edit the line after --static-libs), replace echo -L${exec_prefix}/lib -lSDL2 with echo ${exec_prefix}/lib/libSDL2.a (and preserve the rest of the line). This needs to be done before you make the bundle.
  2. After creating the bundle, copy the dynamic libSDL2 to the bundle and instruct the executable where to find it:
otool -L ScummVM.app/Contents/MacOS/scummvm  | grep SDL2
   <Note the path for the SDL2 library - below we assume it is /usr/local/lib/libSDL2-2.0.0.dylib>
mkdir ScummVM.app/Contents/Frameworks/
cp /usr/local/lib/libSDL2-2.0.0.dylib ScummVM.app/Contents/Frameworks/
install_name_tool -change /usr/local/lib/libSDL2-2.0.0.dylib "@executable_path/../Frameworks/libSDL2-2.0.0.dylib"  ScummVM.app/Contents/MacOS/scummvm

Doing that is not needed if you are only going to use the ScummVM application on the same computer you compiled it on.

Compiling ScummVM via the Xcode GUI

Creating an Xcode project

  • Compile create_project:
cd devtools/create_project/xcode
xcodebuild
  • Run create_project from the root ScummVM directory:
cd ../../..
./devtools/create_project/xcode/build/Release/create_project . --xcode

Note that `create_project` accepts most of the same flags that `configure` accepts.

Build the Xcode project

  • Open the Xcode project
  • Go to Product -> Scheme and set the scheme to "ScummVM-macOS"
  • Go to Product -> Scheme -> Edit Scheme -> Run tab -> Options tab and uncheck "Allow debugging when using document Versions Browser"
  • If the required libraries (such as SDL2) are not in /usr/local, you will need to update the Header Search Paths and Library Search Paths build settings in Xcode.
  • Build with Product -> Build or Product -> Run

Further reading