Skip to content

Building on macOS

Vitaly Novichkov edited this page Jun 12, 2022 · 5 revisions

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.

  1. Clone repository:

    git clone https://github.com/Wohlstand/TheXTech.git
  2. Make sure all submodules were pulled, otherwise, it won't build:

    cd TheXTech
    git submodule init
    git submodule update
  3. Make the building directory:

    mkdir build
    cd build
  4. 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.

  5. 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
    # Or run a Ninja build
    ninja

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.

  1. Make a folder in your home directory:

    mkdir -p ~/TheXTech Games/Debug Assets/
  2. Download one of two archives with compatible assets:

  3. Unpack the content of the archive into your ~/TheXTech Games/Debug Assets/ directory

  4. 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.

  5. Once your game root directory is ready, feel free to run the bin/TheXTech.app executable bundle to start a game.