Building on macOS - TheXTech/TheXTech GitHub Wiki
You need to install the Xcode and CMake (install it manually, or use the HomeBrew or MacPorts to install it from a command line) to build a project.
Optionally, you can install a ninja-build to improve the project building performance!
If you want to make the build for Apple Silicon (ARM64) architecture, you will need to have the Xcode 12 and higher. Also you need to use the CMake 3.18 and newer.
Preparing to build
Before to start the build, you should obtain the source code for TheXTech. You can use the stable version as well as the latest in-development to test out any new experimental features and receive any further bugfixes earlier.
Stable version
If you want to build the stable version, you can simply download the source code archive from the official site or from GitHub releases:
- Download the source code archive from the TheXTech's official page.
- Or download the source code archive from one of GitHub releases pages.
And then, unpack the archive and open the terminal at the just-now unpacked directory that contains the source code for TheXTech.
Important note: Please never use the "Source code" links at Github releases: they are broken. Instead, download the thextech-full-src-v*.*.*
.tar.gz or thextech-full-src-v*.*.*
.tar.bz2 or thextech-full-src-v*.*.*
.zip archive.
This project uses submodules and GitHub is unable to create source code packages that includes submodules too.
Development version
If you want to build the latest in-development version, then, instead of downloading the archive, you can clone the repository itself by running this in a terminal (please open the terminal at the directory where you want to put the clonned repository, so, you will know where it is):
git clone https://github.com/TheXTech/TheXTech.git
Then, Make sure all submodules have been pulled, otherwise, it won't build:
cd TheXTech
git submodule init
git submodule update
Building
At the TheXTech's source code directory, run next commands in the terminal:
-
Make the building directory:
mkdir build cd build
-
Run a CMake configuring:
# when you want to use the regular GNU Make cmake -DCMAKE_BUILD_TYPE=Debug ..
# OR when you want to use Ninja which does better parallel processes management cmake -G Ninja -DCMAKE_BUILD_TYPE=Debug ..
A note: if you going to deploy a release build, the "MinSizeRel" configuration suggested.
Second note: if you going to build for Apple Silicon (ARM64), please add the
-DCMAKE_OSX_ARCHITECTURES="arm64"
argument. Technically it's possible to produce the universal build, however, the build gets broken on attempt. Please make different builds for different architectures yet. However, when you run the build on Apple Silicon machine directly and you want to produce the Intel-compatible build, please specify the-DCMAKE_OSX_ARCHITECTURES="x86_64"
configure argument. -
Run the build itself:
# Run regular GNU Make build with 4 parallel tasks (suggested on 4-core CPU, if you have more cores, use a different number than 4) make -j 4
If you generated
build.ninja
files (usingcmake -G Ninja ...
, such as in the release example) in the last step:# Or run a Ninja build ninja
Now, you should be able to find your App Bundle binaries in
output/bin
. See the "Running and debugging a build" section for how to run them!
Building with Xcode
With the use of CMake, you can use the "Xcode" generator to get the working project for Xcode IDE. Open it and try to build a game with it!
After the build will be complete, you can run the game. Before that, you need to prepare a game root directory in your user directory.
Running and debugging a build
The built game will not work until you will prepare the game root. Please prepare the game root until you will be able to run a game. The game root by default is located in your home directory and you can have multiple builds with different configurations and modes, all will use the same game root directory at your home directory.
-
Make a folder in your home directory:
mkdir -p ~/TheXTech Games/Debug Assets/
-
Download one of two archives with compatible assets:
-
Unpack the content of the archive into your
~/TheXTech Games/Debug Assets/
directory -
Find the "worlds" directory inside and put any compatible episodes you have (all episodes made for an original SMBX 1.3 and earlier will work here, also episodes designed for TheXTech exclusively). Optionally you can make the "battle" folder and put a bunch of level files that will be used for battle arena purposes.
-
Once your game root directory is ready, feel free to run the
bin/TheXTech.app
executable bundle to start a game.