Developer guide

Compile TaystJK

Use an out-of-source CMake build. A release build is for playing; RelWithDebInfo is a useful default for development because it keeps optimization and debug symbols.

Get the source

Install Git, CMake, and a C/C++ compiler, then clone TaystJK:

git clone https://github.com/taysta/TaystJK.git
cd TaystJK

TaystJK is GPLv2 software. If you distribute a changed binary, make the corresponding source available under the same licence.

Common CMake options

Option Default Purpose
BuildMPEngine ON Multiplayer client executable.
BuildMPDed ON Dedicated server executable.
BuildMPGame ON Server-side game module.
BuildMPCGame ON Client-side game module.
BuildMPUI ON UI module.
BuildMPRdVanilla ON Vanilla renderer.
BuildMPRend2 ON Experimental rend2 renderer.
BuildMPRdVulkan ON Vulkan renderer.
BuildPortableVersion OFF Store user files beside the executable.
BuildDiscordRichPresence ON Include Discord Rich Presence where a bundled binary is available.
UseAddressSanitizer OFF Detect many memory errors at runtime.
UseUndefinedSanitizer OFF Detect undefined behavior with GCC/Clang.

The authoritative list is in the top-level CMake configuration.

Compile for your platform

Choose your operating system to see its prerequisites and build steps. Your selection is saved on this device.

Operating system

Windows

Visual Studio 2022 with Desktop development with C++, Git, and CMake is the straightforward toolchain. Bundled libraries are selected by default on Windows.

From a Developer PowerShell prompt:

cmake -S . -B build -G "Visual Studio 17 2022" -A x64
cmake --build build --config RelWithDebInfo --parallel
cmake --install build --config RelWithDebInfo --prefix "C:\TaystJK-test"

You can instead open the generated TaystJK.sln, select RelWithDebInfo and x64, and build the solution. Use Debug when you want the least optimized stepping experience.

Generating the solution with the bundled script

The repository ships a script that asks the questions and runs CMake for you (build/build-windows-msvc.bat). Run it from the build directory. It generates the solution only; it does not compile anything, so open the .sln afterwards and build from Visual Studio.

It asks two things, and pressing Enter takes the default:

Prompt Default
Visual Studio version 2022 (msvc17); 2015, 2017 and 2019 also offered
Architecture 32-bit (x86); choose [2] for x64

Both answers name the folders, so a run with both defaults gives you:

build/msvc17_x86/            the CMake build tree, with TaystJK.sln inside
build/install-msvc17_x86/    where cmake --install puts the result

The pattern is <vs>_<arch> and install-<vs>_<arch>, both relative to build/, so picking VS2022 and x64 gives build/msvc17_x64 and build/install-msvc17_x64 instead. Choosing different answers on a later run therefore configures a separate tree rather than disturbing the first, and the script prints both paths before it starts.

The architecture default is 32-bit, which is not what you usually want: prefer x64 for development, for the rend2 memory reason at the end of this section. Press 2 at that prompt.

Press C at the third prompt to toggle what gets built: the engine, the dedicated server, each renderer backend, the game, cgame and UI modules, Discord Rich Presence, and tests. You can also use it to set a custom install path. Everything except tests is on by default, and portable builds are on, matching what the release workflow produces. If CMake is not on your PATH the script says so and stops rather than failing later.

Prefer an x64 build when developing or testing rend2. Its memory use can exhaust a 32-bit process’s limited address space on demanding maps or asset sets. Build for Win32 only when you need to test a 32-bit compatibility path, such as the shipped EaxMan.dll integration.

macOS

Install Xcode Command Line Tools and CMake. The repository bundles the image libraries and SDL for the default Apple build:

xcode-select --install
brew install cmake
cmake -S . -B build -G Xcode \
  -DCMAKE_INSTALL_PREFIX="$HOME/Library/Application Support/Steam/steamapps/common/Jedi Academy"
cmake --build build --config RelWithDebInfo --parallel

On Apple silicon, CMake selects arm64 from the host architecture and raises the deployment target to macOS 11 when necessary. For a development build, run the install target and then use the repository’s helper to move and sign the installed files:

cmake --build build --config RelWithDebInfo --target install
./scripts/macosx/moveandsign.sh

The helper currently expects the install staging directory under the default Steam location and moves the result to ~/Library/Application Support/TaystJK. Review the path and architecture variables at the top of the script before using it with a different setup. The debugging guide covers pointing CLion at the executable in that installed layout.

Linux

On Debian or Ubuntu, install the normal development dependencies:

sudo apt update
sudo apt install build-essential cmake git libsdl2-dev libgl1-mesa-dev \
  libjpeg-dev libpng-dev zlib1g-dev

Configure, compile, and optionally install into a test staging directory:

cmake -S . -B build \
  -DCMAKE_BUILD_TYPE=RelWithDebInfo \
  -DCMAKE_INSTALL_PREFIX="$HOME/.local/taystjk-test"
cmake --build build --parallel
cmake --install build

For a dedicated-server-only build, disable the client, client modules, and renderers:

cmake -S . -B build-server -DCMAKE_BUILD_TYPE=Release \
  -DBuildMPEngine=OFF -DBuildMPCGame=OFF -DBuildMPUI=OFF \
  -DBuildMPRdVanilla=OFF -DBuildMPRend2=OFF -DBuildMPRdVulkan=OFF
cmake --build build-server --parallel

Install and test

The build output alone does not contain the retail assets. CMAKE_INSTALL_PREFIX is the parent staging directory; TaystJK creates a JediAcademy directory beneath it. Copy the retail base directory into that installed layout, or launch with +set fs_cdPath /path/to/JediAcademy so the engine can find base/assets0.pk3 through assets3.pk3.

Keep test builds separate from the client you use every day. The installation guide shows a shared-asset layout that works well for development.

If configuration fails

This guide is tailored from OpenJK’s broader compilation guide and TaystJK’s current CMake options.

Last changed History Edit this page on GitHub