Skip to content

Building on Haiku

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

The game should work with a default GCC compiler, included with Haiku Beta 1 and higher.

This build is very similar to Linux/xBSD build, however, it has some differences that you need to pay attention on some cases:

  1. A build-in-place of SDL2 gives a not working properly build, therefore, you need to use an SDL2 from the system. Install it via Haiku Depot or via pkgman tool from a command line:

    pkgman install libsdl2 libsdl2_devel cmake ninja
  2. Clone repository:

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

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

    mkdir build
    cd build
  5. 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 is suggested.

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

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 "~/PGE Project/thextech/"
  2. Download one of two archives with compatible assets:

  3. Unpack the content of the archive into your ~/PGE Project/thextech/ directory

  4. Make in the ~/PGE Project/thextech/ directory the "worlds" folder and put any compatible episodes you have (all episodes made for an original SMBX 1.3 and earlier will work here). Optionally you can make the "battle" folder and put a bunch of level fils which will be used for battle arena purposes.

  5. Once your game root directory is ready, feel free to run the output/bin/thextech binary to start a game.