CMake parameters explained - TheXTech/TheXTech GitHub Wiki

The Game gives you a flexible set of options you can use to produce various variants of the game builds for your purposes.

To apply every option from the command line, you need to use the -D... prefix, for example, -DCMAKE_BUILD_TYPE=Debug to set the CMAKE_BUILD_TYPE option with the Debug value.

General options

  • CMAKE_BUILD_TYPE - Specify the type of build:

    • Debug - Disable all optimizations and enable debug symbols. Use this build while hacking, debugging, and developing.
    • Release - The standard release which enables the rest of the optimizations and disables debug symbols.
    • RelWithDebInfo - The release which enables the rest of the optimizations, but keeps debug symbols enabled.
    • MinSizeRel - The release that enables the rest of the optimizations to produce the binary as small as possible. This is the default configuration for official releases of the game.

    Note: When using the Visual Studio or Xcode generator, this option has no major effect. Therefore, you should also specify the --config <build type> option while you run the CMake with the --build . argument to run the actual build.

  • CMAKE_INSTALL_PREFIX - Specify the path where to install the final build of the game. The default value depends on the platform. While the development process, you don't need to install the game, you can use it from the output directory directly.

Debug options

  • ENABLE_ADDRESS_SANITIZER - Enable the address sanitiser of the GCC compiler to detect possible memory leaks or memory access violations on runtime. Disabled by default.
  • ENABLE_LOGGING - Enable the writing of log files during the game working. You may disable it if you don't want to write any log files. Enabled by default.

Libraries options

  • USE_SYSTEM_LIBS - Do find the rest of the dependent libraries from the system prefix. (To get this work, you need to install SDL2 by your package manager or build it separately; and also, you will need to separately build and install the libFreeImageLite and SDL MixerX libraries).

  • USE_SYSTEM_SDL2 - Do use the SDL2 library from the system, but do the local build of libFreeImageLite and MixerX libraries.

  • USE_STATIC_LIBC - Do static link of libc and libstdc++ (or libc++abi at BSD systems) to prevent the manual install of libraries separately. Other dependent libraries will also be statically linked. Do use this flag to produce portable builds.

  • PGE_USE_LOCAL_SDL2 - Use the vendored copy of SDL2 from the AudioCodecs repository. Enabled by default.

  • USE_SHARED_FREEIMAGE - Do build the local libFreeImageLite as a shared library. By default, this library is built as a static library that links with the game build.

  • USE_FREEIMAGE_SYSTEM_LIBS - Require libFreeImageLite to use libPNG and libJPEG libraries from the system environment. Otherwise, those libraries getting built in a place. Use this option on deploying to embedded systems to guarantee all required PNG/JPEG side optimizations for ARM/MIPS/PowerPC/Intel are properly enabled.

  • FREEIMAGE_PIC - Enable or disable the position independent code compilation mode for the vendored FreeImage library.

  • USE_PNG_HARDWARE_OPTIMIZATIONS - Disable or enable hardware optimisations for the vendored libPNG library.

  • PGE_SHARED_SDLMIXER - Do build the local MixerX as a shared library. The default ON at Windows, Linux, x-BSD, and Haiku.

Engine feature options

  • RANGE_ARR_USE_HEAP - Make use of the heap instead of static arrays to store the internal data such as item arrays (blocks, BGO, NPC, etc.). This option should slightly reduce the size of the final binary. Keep a note that this would slow down the whole performance.
  • RANGE_ARR_UNSAFE_MODE - Disable the rest of safety checks at the range array class implementation to increase the performance. Disabled by default. Keep a note that this may lead to a possible SIGSEGV failure when an invalid index got been passed.
  • ENABLE_ANTICHEAT_TRAP - Makes redigitiscool cheat code a trap that will remove the game save and will immediately stop the game with a message box. Disabled by default. Use this option if you really won't make players cheat.
  • ENABLE_OLD_CREDITS - Enforce original Redigit's credits as they were in the original SMBX 1.3 game. Disabled by default.
  • THEXTECH_ENABLE_AUDIO_FX - Enable the real-time audio effects system. Enabled by default.
  • THEXTECH_ENABLE_LUNA_AUTOCODE - Enable the LunaScript sub-system, the LunaDLL Autocode implementation. Enabled by default.
  • THEXTECH_ENABLE_DISCORD_RPC - Enable the Discord RPC support. Enabled by default. Available only on Windows x86 and x86_64, on macOS x86_64 and ARM64, and on Linux x86_64.

Engine meta options

  • THEXTECH_GAME_NAME_TITLE - Custom game title that is shown in the title bar of the window.
  • THEXTECH_CREDITS_URL - Custom URL that is shown on the outro screen.
  • THEXTECH_CREDITS_TITLE - Custom game title that is shown on the outro screen.

Engine deployment options

  • THEXTECH_PACKAGE_NAME - The name of the archive package resulted by using the "cpack" utility.
  • THEXTECH_EXECUTABLE_NAME - The name of the executable file built.
  • THEXTECH_PRELOAD_ENVIRONMENT - macOS and Emscripten only - The absolute path to the assets root to pack with the bundle or the WebAssembly build.
  • THEXTECH_BUNDLE_NAME - macOS only - The name of the built bundle.
  • THEXTECH_ICON_NAME - macOS only - The icon filename packed into the bundle.
  • THEXTECH_CUSTOM_ICON_PATH - macOS only - The absolute path to the ICNS file to include as the bundle icon.
  • THEXTECH_CUSTOM_USERDATA_DIR_NAME - macOS only - The name of the custom resources at the user home directory to add custom episodes and battle levels ("TheXTech Episodes" is the default name).
  • THEXTECH_FIXED_ASSETS_PATH - Only for Linux, x-BSD, Haiku, and other UNIX-like systems - The constant absolute path to the assets. Use this option to produce something like a DEB or RPM package of the game including assets. Suggested to use something like the /usr/share/games/<game-name>/ path.
  • THEXTECH_USER_DIR_NAME - Only for Linux, x-BSD, Haiku, and other UNIX-like systems - The name for the custom resources at the user's home directory to store settings and user-added episodes for the game. The default is PGE_Project/thextech/. The dot gets added to the beginning of a directory name automatically.
⚠️ **GitHub.com Fallback** ⚠️