Building the project
Guide how to build Jazz² Resurrection.
The project requires following tools and libraries to build it successfully:
- CMake 3.15 or newer
- C++ compiler with C++17 support — any newer version of GCC, Clang and MSVC should work, MinGW and Clang-CL toolchains should be also supported
- OpenGL 3.3, OpenGL|ES 3.0 or WebGL 2.0 library (alternatively ANGLE or Mesa translation library)
- GLEW library (required only on Windows)
- GLFW or SDL2 library (not required on Android and UWP, because these platforms use a different backend)
- libcurl library (not required on Emscripten and Windows, because these platforms use a different backend)
- zlib library
In addition, these libraries are required for an optimal experience:
- OpenAL library — audio support
- libopenmpt library — module music playback
- libogg / libvorbis library —
.oggfile support (not needed for the original assets) - libwebp library —
.webpfile support (currently not supported, not needed for the original assets) - AngelScript library — AngelScript scripting support
- liblua library — Lua scripting support (currently not supported)
It tries to download or compile all libraries automatically, but in case of build errors a manual download is necessary. Also, system-wide libraries have priority over the bundled ones, so in case of any incompatibility just install the system libraries.
How to get started
Clone the repository using any Git client, IDE, or command line:
git clone https://github.com/deathkiller/jazz2-native.git
To configure CMake, following commands can be used:
mkdir build cmake -B build -D CMAKE_BUILD_TYPE=Debug -D NCINE_CREATE_CONTENT_SYMLINK=ON
Alternatively, change CMAKE_BUILD_TYPE to Release to enable all performance optimizations and disable debugging. You can also specify build configuration parameters, which are described below. In addition, you can use the NCINE_CREATE_CONTENT_SYMLINK parameter to automatically create a symbolic link to the "Content" directory in the target directory, otherwise you would have to copy it to "build" directory manually. To start actual build of the project, use following commands:
make -j $(nproc) -C build
Everything should be built into the "build" directory and ready to go.
Building on Android
Android build requires Android SDK and NDK installed, see Get started with the NDK. Assembling APK files also requires Gradle. Path to Gradle can be supplied by GRADLE_HOME environment variable if not detected automatically. The build can be configured using a similar command as above:
mkdir build cmake -B build -D CMAKE_BUILD_TYPE=Debug \ -D NCINE_BUILD_ANDROID=ON \ -D NCINE_UNIVERSAL_APK=ON \ -D NCINE_NDK_ARCHITECTURES="arm64-v8a;armeabi-v7a"
See Platform-specific parameters for Android for more details. Then following commands can be used to build the project and assemble the APK file:
make -j $(nproc) -C build cd build gradle assembleDebug
Alternatively, replace assembleDebug with assembleRelease to create release APK file.
Building on Windows
On Windows, Visual Studio can be used. Using already included .sln is not recommended, because it requires manual configuration and doesn't support all features and parameters. Instead the project can be opened as CMake directory directly in Visual Studio, or it can be configured using a similar command as above:
mkdir build cmake -B build -D CMAKE_BUILD_TYPE=Debug -A x64 ^ -D CMAKE_SYSTEM_PROCESSOR=x64 ^ -D NCINE_CREATE_CONTENT_SYMLINK=ON
See Platform-specific parameters for Windows for more details. To build it for 32-bit operating system, use Win32 instead of x64. To change version of VS toolset, use -D CMAKE_GENERATOR_TOOLSET=… parameter. By default CMake creates a new Visual Studio .sln solution and project files in "build" directory that can be opened easily afterwards. Building with Clang-CL compiler is also possible specifying -T ClangCL parameter.
Building for Xbox (Universal Windows Platform)
The same commands can be used as for Windows, but two additional parameters must be specified to change the target:
cmake -B build -D CMAKE_BUILD_TYPE=Debug -A x64 ^ -D CMAKE_SYSTEM_PROCESSOR=x64 ^ -D CMAKE_SYSTEM_NAME=WindowsStore ^ -D CMAKE_SYSTEM_VERSION="10.0"
Additionaly, a code-signing certificate is required to create an installable .msixbundle package. See Platform-specific parameters for Universal Windows Platform for more details.
Build configuration parameters
By default it tries to find the first available backend for the currently installed libraries. GLFW is usually preferred over SDL2, because it's more lightweight. On the other hand, SDL2 usually has better gamepad support and better support in general. The following parameters can be used to customize the build:
CMAKE_BUILD_TYPE— Build configuration- Possible values:
Debug,Release
- Possible values:
CMAKE_INSTALL_PREFIX(default"/usr/local") — Install prefix on Unix systemsNCINE_CONTENT_DIR(default"./Content") — Path to the"Content"game data directory- Some build targets include
"Content"directory directly inside the executable package (e.g., Android)
- Some build targets include
NCINE_CREATE_CONTENT_SYMLINK(defaultOFF) — Create symbolic link to the"Content"game data directory in target directory- Ignored on Android, Emscripten, Nintendo Switch and UWP platforms
NCINE_DOWNLOAD_DEPENDENCIES(defaultON) — Download all missing dependencies automaticallyNCINE_EMBED_SHADERS(defaultON) — Embed shader files in executableNCINE_PREFERRED_BACKEND(default"GLFW") — Preferred backend on desktop- Possible values:
GLFW,SDL2 - Ignored on Android and UWP platforms
- Possible values:
NCINE_VERSION_FROM_GIT(defaultON) — Set current game version from Git repository automaticallyNCINE_WITH_THREADS(defaultONexcept on Emscripten) — Allow to use multiple threads for better performanceNCINE_WITH_OPENGLES(defaultOFF) — Use OpenGL|ES library instead of OpenGLNCINE_WITH_ANGLE(defaultOFFexcept on UWP) — Enable Google ANGLE library supportNCINE_WITH_GLEW(defaultON) — Use GLEW libraryNCINE_WITH_BACKWARD(defaultONexcept on Android, Emscripten and UWP) — Enable better exception handlingNCINE_WITH_WEBPdeprecated — Enable.webpimage file support, requires libwebp libraryNCINE_WITH_AUDIO(defaultON) — Enable audio support, requires OpenAL libraryNCINE_WITH_VORBIS(defaultON) — Enable.oggaudio file support, requires libvorbis libraryNCINE_WITH_OPENMPT(defaultON) — Enable module music audio file support, requires libopenmpt libraryNCINE_COMPILE_OPENMPT(defaultOFF) — Download and compile libopenmpt library from source automatically
NCINE_WITH_ANGELSCRIPT(defaultOFF) — Enable AngelScript scripting supportANGELSCRIPT_VERSION_TAGallows to specify the version to be downloaded ifNCINE_DOWNLOAD_DEPENDENCIESis enabled
NCINE_WITH_LUAdeprecated — Enable Lua scripting supportNCINE_WITH_IMGUI(defaultOFF) — Enable integration with Dear ImGui libraryIMGUI_VERSION_TAGallows to specify the version to be downloaded
Platform-specific parameters for Android
NCINE_BUILD_ANDROID(defaultOFF) — Enable building for Android platformNCINE_ASSEMBLE_APK(defaultON) — Assemble Android APK file, requires with GradleNCINE_NDK_ARCHITECTURES(default"arm64-v8a") — Semicolon-separated list of target CPU architectures- Possible values:
arm64-v8a(for 64-bit ARM),armeabi-v7a(for 32-bit ARM),x86,x86_64
- Possible values:
NCINE_UNIVERSAL_APK(defaultOFF) — Create universal APK containing all specified CPU architecturesNDK_DIR— Android NDK directory, usually detected automatically
Platform-specific parameters for Linux
NCINE_ASSEMBLE_DEB(defaultOFF) — Assemble DEB package of the gameNCINE_ASSEMBLE_RPM(defaultOFF) — Assemble RPM package of the gameNCINE_BUILD_FLATPAK(defaultOFF) — Build Flatpak version of the gameNCINE_LINUX_PACKAGE— Override Linux package name, otherwise"Jazz² Resurrection"will be usedNCINE_OVERRIDE_CONTENT_PATH— Override"Content"directory path- If not specified, following path will be used:
CMAKE_INSTALL_PREFIX "/share/" NCINE_LINUX_PACKAGE "/Content/"
- If not specified, following path will be used:
NCINE_PACKAGED_CONTENT_PATH(defaultOFF) — Use alternative path search strategy- If enabled,
"Content"will be always relative to current directory - Has higher priority than
NCINE_OVERRIDE_CONTENT_PATH
- If enabled,
Platform-specific parameters for Windows
DEATH_WITH_VC_LTL(defaultON) — Build with VC-LTL for lighter binaries, requires VC-LTLNCINE_COPY_DEPENDENCIES(defaultON) — Copy all required libraries to build target directory automatically
Platform-specific parameters for Universal Windows Platform
NCINE_UWP_CERTIFICATE_THUMBPRINT— Code-signing certificate thumbprint- Use either
NCINE_UWP_CERTIFICATE_THUMBPRINTorNCINE_UWP_CERTIFICATE_PATH
- Use either
NCINE_UWP_CERTIFICATE_PATH(default"UwpCertificate.pfx") — Code-signing certificate pathNCINE_UWP_CERTIFICATE_PASSWORD(optional) — Code-signing certificate password forNCINE_UWP_CERTIFICATE_PATH
Advanced parameters
DEATH_CPU_USE_RUNTIME_DISPATCH— Build with runtime dispatch for CPU-dependent functionality- Uses code paths optimized for multiple architectures with the best-matching variant selected at runtime based on detected CPU features, see Death::
Cpu namespace - Enabled by default if
DEATH_CPU_USE_IFUNCis supported
- Uses code paths optimized for multiple architectures with the best-matching variant selected at runtime based on detected CPU features, see Death::
DEATH_CPU_USE_IFUNC(defaultONif supported) — Allow using GNU IFUNC for runtime CPU dispatchDEATH_DEBUG— Enable verbose logging and additional assertions for debugging- Enabled by default for
Debugbuild configuration
- Enabled by default for
DEATH_DEBUG_SYMBOLS— Create debug symbols for executable- Separate
.pdbfile will be created on Windows and Linux, on other platforms the symbols will probably be embedded in the executable - Enabled by default on Windows platforms
- Separate
DEATH_TRACE(defaultON) — Enable runtime event tracing, see Asserts.h fileDEATH_TRACE_ASYNC(defaultONifNCINE_WITH_THREADS) — Enable asynchronous processing of event tracing for better performanceDEATH_USE_RUNTIME_CAST(defaultON) — Enable Death::runtime_cast() and type information optimization NCINE_ADDRESS_SANITIZER(defaultOFF) — EnableAddressSanitizermemory error detectorNCINE_ARCH_EXTENSIONS— Target CPU architecture extensions (instruction sets)NCINE_CODE_COVERAGE(defaultOFF) — Enablegcovinstrumentation for testing code coverageNCINE_GCC_HARDENING(defaultOFF) — Enable memory corruption mitigation methods of GCCNCINE_LINKTIME_OPTIMIZATION(defaultON) — Compile with link-time optimizationNCINE_THREAD_SANITIZER(defaultOFF) — EnableThreadSanitizerdetectorNCINE_UNDEFINED_SANITIZER(defaultOFF) — EnableUndefinedBehaviorSanitizerdetector
Debugging parameters
NCINE_AUTOVECTORIZATION_REPORT(defaultOFF) — Enable report generation from compiler auto-vectorizationNCINE_INPUT_DEBUGGING(defaultOFF) — Enable extensive (gamepad) input debugging and loggingNCINE_PROFILING(defaultOFF) — Enable profilingNCINE_STRIP_BINARIES(defaultOFF) — Strip debug symbols from binaries for smaller sizeNCINE_WITH_FIXED_BATCH_SIZE(defaultOFF) — Enable fixed batch size for renderingNCINE_WITH_RENDERDOCdeprecated — Enable integration with RenderDocNCINE_WITH_TRACY(defaultOFF) — Enable integration with Tracy frame profilerTRACY_VERSION_TAGallows to specify the version to be downloaded
Game-specific parameters
DISABLE_RESCALE_SHADERS(defaultOFF) — Disable rescale shaders and use only nearest neighborSHAREWARE_DEMO_ONLY(defaultOFF) — Shareware Demo only, usually used on Emscripten platformWITH_MULTIPLAYER(defaultOFF) — Enable experimental online multiplayer supportDEDICATED_SERVER(defaultOFF) — Build the application as dedicated server only,WITH_MULTIPLAYERmust be enabled