Build Guide

CMake configuration and build commands for every supported platform.

Engine Backend Selection

The CMake variable GALAXY_EGGBERT_ENGINE selects the engine:

ValueEngineStatus
U3D (default)u3d-community/U3D (Urho3D fork)Stable
NOVA3DRobert Vokac's Nova3D forkWIP

Linux Native Build (U3D + EasyGL)

cmake -S . -B build-linux \
  -DCNA_BACKEND_SDL_RENDERER=OFF \
  -DCNA_BACKEND_EASY_GL=ON \
  -DCNA_BACKEND_BGFX=OFF
cmake --build build-linux --target GalaxyEggbert -j2
Note Use -j2 maximum parallel jobs to protect RAM. Crashes with more parallel jobs have been observed in memory-constrained sessions.

Linux Native Build (U3D — primary recommended path)

# Set U3D_HOME if not using the default path
cmake -S . -B cmake-build-u3d \
  -DGALAXY_EGGBERT_ENGINE=U3D \
  -DU3D_HOME=/path/to/U3D/cmake-build-debug
cmake --build cmake-build-u3d --target GalaxyEggbert -j2

Windows Native Build

Run on Windows with a MinGW or MSVC compiler:

cmake -S . -B build-windows \
  -DCNA_BACKEND_SDL_RENDERER=ON \
  -DCNA_BACKEND_EASY_GL=OFF \
  -DCNA_BACKEND_BGFX=OFF
cmake --build build-windows --target GalaxyEggbert

Windows Cross-Build from Linux (MinGW-w64)

# Install MinGW-w64 first:
sudo apt install mingw-w64

# Always use a clean build directory when switching toolchains:
rm -rf build-windows

cmake -S . -B build-windows \
  -DCMAKE_TOOLCHAIN_FILE=cmake/toolchains/mingw-w64.cmake \
  -DGALAXY_EGGBERT_ENGINE=U3D \
  -DU3D_HOME=/path/to/U3D/build-windows \
  -DBUILD_TESTING=OFF
cmake --build build-windows --target GalaxyEggbert -j2
Important Always start with a clean build-windows/ directory when switching from a Linux-native to a MinGW toolchain build. Mixing toolchains in the same directory causes CMake cache corruption.

The resulting build-windows/GalaxyEggbert.exe is a PE32+ x86-64 binary, statically linked against libgcc and libstdc++.

Web Build (Emscripten) — Nova3D only

U3D not supported The U3D backend cannot be built for Emscripten/Web. Use GALAXY_EGGBERT_ENGINE=NOVA3D.

Step 1 — Install Emscripten SDK

git clone https://github.com/emscripten-core/emsdk.git
cd emsdk
./emsdk install latest
./emsdk activate latest
source ./emsdk_env.sh

Step 2 — Configure

source /path/to/emsdk/emsdk_env.sh
emcmake cmake -S . -B cmake-build-web \
  -DGALAXY_EGGBERT_ENGINE=NOVA3D \
  -DCMAKE_BUILD_TYPE=Debug

Step 3 — Build

cmake --build cmake-build-web -j

Generated Files

FileDescription
GalaxyEggbert.htmlMain entry — open in browser
GalaxyEggbert.jsEmscripten JS glue code
GalaxyEggbert.wasmWebAssembly binary
GalaxyEggbert.dataPreloaded asset bundle

Running Tests

# Configure with tests enabled (default for non-web, non-android builds)
cmake -S . -B cmake-build-u3d -DBUILD_TESTING=ON
cmake --build cmake-build-u3d --target GalaxyEggbertWorldsTests

# Run tests
ctest --test-dir cmake-build-u3d --output-on-failure

The test suite (GalaxyEggbertWorldsTests) covers the Worlds/ data model only. It has no dependency on U3D or any graphics library — 54 tests run purely in C++.

Generating API Docs (Doxygen)

cmake --build cmake-build-u3d --target GalaxyEggbertDocs

Output goes to cmake-build-u3d/html/. Requires doxygen to be installed.

CMake Variables Reference

VariableDefaultDescription
GALAXY_EGGBERT_ENGINEU3DEngine backend: U3D or NOVA3D
U3D_HOME(auto)Path to pre-built U3D library directory
BUILD_TESTINGONEnable GoogleTest unit tests
CNA_BACKEND_SDL_RENDERERvariesUse SDL Renderer backend (Nova3D only)
CNA_BACKEND_EASY_GLvariesUse EasyGL OpenGL backend (Nova3D only)
CNA_BACKEND_BGFXOFFUse BGFX backend (Nova3D only, experimental)
CMAKE_TOOLCHAIN_FILE(none)Toolchain file for cross-compilation