-
Notifications
You must be signed in to change notification settings - Fork 0
Build on macOS
Be sure to check Build for generic instructions.
EmptyEpsilon supports building on both Intel and M-series ARM (M1, M2, etc.) architectures.
If you're building and running EmptyEpsilon locally for development purposes, follow the instructions in the "Basic app target" section.
If you intend to build a DMG for distribution to players that includes all necessary dependencies, follow the instructions in the "DMG packaging" section.
The result of these steps builds a standard macOS .app, but might require external dependencies.
-
Install XCode:
xcode-select --install
-
Install the Homebrew package manager to install some dependencies before compiling EmptyEpsilon.
-
Install
cmaketo compile your code, and thesdl2dependency that EmptyEpsilon needs. You can also installgitviabrewif necessary.
Note: some users have reported build issues with cmake version 4.x. If that happens to you, try downgrading to cmake 3.31.4brew install cmake sdl2
You can also compile or install pre-compiled SDL2 libraries yourself. Refer to the official documentation.
-
Create a new directory named
emptyepsilonwhere the game sources will be fetched, and download SeriousProton (game engine) and EmptyEpsilon (the actual game).mkdir -p emptyepsilon && cd emptyepsilon git clone git@github.com:daid/SeriousProton.git git clone git@github.com:daid/EmptyEpsilon.git
NOTE: To get the source anonymously (if you don't have a GitHub account), use these two commands instead:
git clone https://github.com/oznogon/SeriousProton.git git clone https://github.com/oznogon/EmptyEpsilon.git
If you're building a specific release of EmptyEpsilon, remember to checkout the correct tag in both repositories as mentioned in the generic Build instructions!
-
Go to the
EmptyEpsilondirectory and compile the game.cd EmptyEpsilon mkdir _build cd _build cmake .. -DCMAKE_INSTALL_PREFIX=. -DSERIOUS_PROTON_DIR=../../SeriousProton/ -DCMAKE_POLICY_VERSION_MINIMUM=3.5 make && make install
makebuilds the binary executable only, whilemake installcopies necessary assets into the.appbundle.
Once it's built, you can open the game normally by double-clicking the app bundle, or by running it:
EmptyEpsilon.appTo output log information to a terminal window, run the executable within the bundle:
EmptyEpsilon.app/Contents/MacOS/EmptyEpsilonNOTE: Alternatively, you can rebuild and launch using
make && make install && ./EmptyEpsilon.app/Contents/MacOS/EmptyEpsilon.
Game assets, including models, scripts, and music, are stored within the bundle at EmptyEpsilon.app/Contents/Resources/. The Preferences file is saved to ~/.emptyepsilon/options.ini.
NOTE: The compiled app still requires SDL2 libraries, such as the Homebrew
sdl2package, to be installed locally. See DMG packaging to add SDL2 to the app bundle.
If using the VSCode IDE, intellisense can be achieved for most files using the following .vscode/settings.json file:
{
"editor.formatOnSave": false,
"C_Cpp.default.includePath": [
"${workspaceFolder}/src",
"${workspaceFolder}/src/**",
"${workspaceFolder}/../SeriousProton/src",
"${workspaceFolder}/../SeriousProton/src/**",
"${workspaceFolder}/_build/_deps/glm-src"
],
}To aid compatibility with specific older versions of OS X/macOS, use the MACOSX_DEPLOYMENT_TARGET environment variable to set a minimum Mac OS X/macOS target version. Setting this lower than 10.15 (EE's default since may 2021) might cause problems when compiling with newer versions of XCode, and SDL2 does not support targeting OS X 10.5 and older.
You can also set this in EmptyEpsilon's CMakeLists.txt, around the top:
set(ENV{MACOSX_DEPLOYMENT_TARGET} "11.0")Since May 2021, EE supports packaging a DMG directly through CMake that contains all necessary dependencies for distribution to players.
- Install the Homebrew package manager to install some dependencies before compiling EmptyEpsilon.
- Install
cmakeandninjato be installed, which you can do via homebrew:-
brew install cmake ninja
-
- Create a folder to put all of your EmptyEpsilon files. For example,
~/Documents/emptyepsilon-compile - Download SDL2
- To generate a DMG package, you cannot use the sdl2 package from homebrew!. Relocatable packages require Frameworks, which homebrew does not install.
-
NOTE: Frameworks and homebrew-installed libraries for SDL2 should not be installed simultaneously. However, brew's
sdl2package might be installed as a dependency of other homebrew packages, particularlyffmpeg. If you have issues building EmptyEpsilon, you might need to remove all such homebrew package dependencies so you can remove thesdl2package.
- Create a folder to put your SDL2
.dmgfile. For example,~/Documents/emptyepsilon-compile/SDL2-dmg -
Download the official SDL2 DMG release and save it in
~/Documents/emptyepsilon-compile/SDL2-dmg.
- Open a terminal and change directories to
~/Documents/emptyepsilon-compile/SDL2-dmg - Run the following:
-
# Update the following version number to the version you downloaded cd ~/Documents/emptyepsilon-compile/SDL2-dmg export SDL2_VERSION=2.30.9 hdiutil attach SDL2-${SDL2_VERSION}.dmg
-
- Clone a copy of the EmptyEpsilon and SeriousProton source code in
~/Documents/emptyepsilon-compile-
cd ~/Documents/emptyepsilon-compile git clone https://github.com/oznogon/SeriousProton git clone https://github.com/oznogon/EmptyEpsilon
-
- Decide which version of EmptyEpsilon you'd like to compile. Check out the appropriate git tag:
-
cd ~/Documents/emptyepsilon-compile/SeriousProton git checkout EE-2024.08.09 cd ~/Documents/emptyepsilon-compile/EmptyEpsilon git checkout EE-2024.08.09
-
- Create a
sdl2-config.cmakefile which targets the framework. Save it as~/Documents/emptyepsilon-compile/sdl2-config.cmake-
# sdl2-config.cmake # By default, hdiutil will attach to /Volumes/SDL2 set(_SDL2_mountpoint /Volumes/SDL2) find_library(SDL2_LIBRARIES SDL2 PATHS "${_SDL2_mountpoint}") find_path(SDL2_INCLUDE_DIRS SDL.h PATHS "${SDL2_LIBRARIES}" PATH_SUFFIXES Headers) set(SDL2_FRAMEWORK_PATH "${_SDL2_mountpoint}/SDL2.framework") set(SDL2_INCLUDE_DIR "${SDL2_FRAMEWORK_PATH}/Headers") set(SDL2_INCLUDE_DIRS "${SDL2_INCLUDE_DIR};${SDL2_FRAMEWORK_PATH}")
-
- Change directories to your EmptyEpsilon source code directory:
-
cd ~/Documents/emptyepsilon-compile/EmptyEpsilon
-
- Run the following commands:
-
# Run this from your EmptyEpsilon source code directory: ~/Documents/emptyepsilon-compile/EmptyEpsilon SDL2_CONFIG_DIR=.. -
# Run this from your EmptyEpsilon source code directory: ~/Documents/emptyepsilon-compile/EmptyEpsilon # Be sure to update `DCPACK_PACKAGE_VERSION_MAJOR`, `DCPACK_PACKAGE_VERSION_MINOR`, # and `DCPACK_PACKAGE_VERSION_PATCH` to match the version number you've selected to compile cmake -G Ninja \ -DCMAKE_BUILD_TYPE:STRING=RelWithDebInfo \ -DCPACK_GENERATOR:STRING=DragNDrop \ -DSDL2_DIR:PATH=$SDL2_CONFIG_DIR \ -DSERIOUS_PROTON_DIR=../SeriousProton \ -DCPACK_PACKAGE_VERSION_MAJOR=2024 \ -DCPACK_PACKAGE_VERSION_MINOR=08 \ -DCPACK_PACKAGE_VERSION_PATCH=09 \ -B _build
-
# Run this from your EmptyEpsilon source code directory: ~/Documents/emptyepsilon-compile/EmptyEpsilon cmake --build _build --target package --parallel
-
- If compilation finishes successfully, you should have an EmptyEpsilon
.dmgin your~/Documents/emptyepsilon-compile/EmptyEpsilon/_build/directory, that can be used to install the game or shared with others.
If the build fails with an error about the freetype framework being missing:
CMake Error at /usr/local/Cellar/cmake/3.22.1/share/cmake/Modules/BundleUtilities.cmake:458 (message):
otool -l failed: 1
error: /Library/Developer/CommandLineTools/usr/bin/otool-classic: can't
open file: @rpath/../Frameworks/freetype.framework/Versions/A/freetype (No
such file or directory)
You may need to install it using homebrew, and also manually link it to a path being searched during the build:
brew install freetype
ln -s /usr/local/lib/freetype.framework /Library/Frameworks/If this still doesn't work, you may need to specify the homebrew path as a CMAKE_PREFIX_PATH when running the cmake --build command:
CMAKE_PREFIX_PATH=/usr/local/lib/freetype.framework cmake --build _build --target package --parallelThis might build the DMG, but the resulting app might still fail with a missing freetype library error, in which case ?? please help
- Home
- Building and installing the game
- Configuring the game
- Playing the game
- Officer roles and screens
- Captain
- Main screen
- Ship window
- Crews of 5-6 players
- Crews of 3-4 players
- Single-player crew
- Game Master (GM) screens
- Extra screens
- Minigames
- Weapon types
- Officer roles and screens
- Extending the game
- Troubleshooting
- Fork content