### Compile and Install innoextract from Git Snapshot Source: https://github.com/diasurgical/devilutionx/wiki/Extracting-MPQs-from-the-GoG-installer Clones the innoextract repository, configures the build using CMake, compiles the source code, and installs the executable. This process requires Git to be installed. ```bash git clone https://github.com/dscharrer/innoextract.git cd innoextract/cmake/ cmake .. make sudo make install ``` -------------------------------- ### Install optional MPQ build tool Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Install smpq for building the devilutionX.mpq file. ```bash sudo apt-get install smpq ``` -------------------------------- ### Install Google Benchmark Comparison Tool Source: https://github.com/diasurgical/devilutionx/blob/master/docs/benchmarking.md Clones and installs the dependencies required for the Google Benchmark comparison utility. ```bash git clone git@github.com:google/benchmark.git ~/google-benchmark cd ~/google-benchmark/tools pip3 install -r requirements.txt cd - ``` -------------------------------- ### Example OpenDingux/RetroFW Build Command Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Example command for building DevilutionX for the rg350 platform using a specific toolchain path. ```bash TOOLCHAIN=/opt/gcw0-toolchain Packaging/OpenDingux/build.sh rg350 ``` -------------------------------- ### Configure Installation Paths and Assets Source: https://github.com/diasurgical/devilutionx/blob/master/CMakeLists.txt Defines installation destinations for icons, metadata, and optional shared libraries. ```cmake DESTINATION "share/diasurgical/${project_name}/mods" ) install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/icon_flat.png" DESTINATION "share/icons/hicolor/512x512/apps" RENAME "${project_name}.png" ) install(FILES "${PROJECT_SOURCE_DIR}/Packaging/resources/hellfire.png" DESTINATION "share/icons/hicolor/512x512/apps" RENAME "${project_name}-hellfire.png" ) install(FILES "${PROJECT_SOURCE_DIR}/Packaging/nix/devilutionx.metainfo.xml" DESTINATION "share/metainfo" RENAME "${project_name}.metainfo.xml" ) if(DISCORD_SHARED_LIB) install(FILES "${DISCORD_SHARED_LIB}" DESTINATION "lib") endif() ``` -------------------------------- ### Get Information about GOG Diablo Installer Source: https://github.com/diasurgical/devilutionx/wiki/Extracting-MPQs-from-the-GoG-installer Retrieves metadata about the GOG Diablo installer, such as supported languages and whether the setup is password-protected. Adjust the filename if necessary. ```bash innoextract --info 'setup_diablo_1.09_hellfire_v4_(78466).exe' ``` -------------------------------- ### Install WSL and Ubuntu Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Command to install WSL and Ubuntu 24.04 on Windows. ```bash wsl --install -d Ubuntu-24.04 ``` -------------------------------- ### Build DevilutionX on NetBSD Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Install dependencies via pkgin and compile. ```bash pkgin install cmake SDL2 libsodium libpng bzip2 googletest ``` ```bash cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release cmake --build build -j $(sysctl -n hw.ncpu) ``` -------------------------------- ### Build DevilutionX on FreeBSD Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Install dependencies via pkg and compile. ```bash pkg install cmake sdl2 libsodium libpng bzip2 googletest ``` ```bash cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release cmake --build build -j $(sysctl -n hw.ncpu) ``` -------------------------------- ### Install MinGW Build Tools Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Installs necessary build tools and libraries for MinGW development. ```bash sudo apt-get update sudo apt-get install cmake git libz-mingw-w64-dev mingw-w64 mingw-w64-tools smpq wget ``` -------------------------------- ### Install Nintendo Switch dependencies Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Use dkp-pacman to install the necessary packages for building on Nintendo Switch. ```bash sudo (dkp-)pacman -S --needed - < Packaging/switch/packages.txt ``` -------------------------------- ### Build DevilutionX on OpenBSD Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Install dependencies via pkg_add and compile using gmake. ```bash pkg_add cmake sdl2 libsodium png bzip2 gmake gtest ``` ```bash cmake -S. -Bbuild -DCMAKE_MAKE_PROGRAM=gmake -DCMAKE_BUILD_TYPE=Release cmake --build build -j $(sysctl -n hw.ncpuonline) ``` -------------------------------- ### Install optional translation dependencies Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Install tools required for building translations. ```bash sudo apt-get install gettext poedit ``` -------------------------------- ### Install dependencies on Debian and Ubuntu Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Install required development packages for building on Debian-based systems. ```bash sudo apt-get install cmake g++ libsdl2-dev libsodium-dev libpng-dev libbz2-dev libgtest-dev libgmock-dev libbenchmark-dev libsdl2-image-dev libfmt-dev ``` -------------------------------- ### Install 64-bit Haiku Dependencies Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Installs necessary development packages for compiling DevilutionX on a 64-bit Haiku system. ```bash pkgman install cmake libsdl2_devel libsodium_devel libpng16_devel bzip2_devel gtest_devel gettext getconf ``` -------------------------------- ### Assert String Example Source: https://github.com/diasurgical/devilutionx/blob/master/docs/BACKGROUND.md Example of an assert string recovered from the debug release of the PE executable. ```text "plr[myplr].InvGrid[i] <= plr[myplr]._pNumInv" ``` -------------------------------- ### Install dependencies on Fedora Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Install required development packages for building on Fedora. ```bash sudo dnf install cmake gcc-c++ glibc-devel libstdc++-static SDL2-devel SDL2_image-devel libsodium-devel libpng-devel bzip2-devel gmock-devel gtest-devel google-benchmark-devel libasan libubsan fmt-devel ``` -------------------------------- ### Install Nintendo 3DS dependencies Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Install the required devkitARM and 3DS-specific libraries using dkp-pacman. ```bash sudo (dkp-)pacman -S \ devkitARM general-tools 3dstools libctru \ citro3d 3ds-sdl 3ds-libpng 3ds-bzip2 \ 3ds-cmake 3ds-pkg-config picasso 3dslink ``` -------------------------------- ### Manage Permissions and Dependencies Source: https://github.com/diasurgical/devilutionx/wiki/Setting-Up-DevilutionX-on-Retropie Commands to grant execution rights to the binary and install the required SDL2 library. ```bash chmod u+x devilutionx ``` ```bash apt install libsdl2-2.0-0 ``` -------------------------------- ### Running DevilutionX with Arguments on Linux Source: https://github.com/diasurgical/devilutionx/wiki/Launching-with-Additional-Arguments Example of how to integrate command-line arguments into a bash script for running DevilutionX on Linux. ```APIDOC ```bash DXPath="/mnt/SDCARD/DevilutionX" savedir="$DXPath/saves" configdir="$DXPath/config" mkdir -p "$savedir" mkdir -p "$configdir" $DXPath/devilutionx --data-dir "$DXPath" --save-dir "$savedir" --config-dir "$configdir" ``` ``` -------------------------------- ### Install 32-bit Haiku Dependencies Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Installs necessary development packages for compiling DevilutionX on a 32-bit Haiku system. ```bash pkgman install cmake_x86 devel:libsdl2_x86 devel:libsodium_x86 devel:libpng_x86 devel:bzip2_x86 ``` -------------------------------- ### Install gperftools on Debian/Ubuntu Source: https://github.com/diasurgical/devilutionx/blob/master/docs/profiling-linux.md Installs the gperftools library, which provides CPU and heap profilers. This is a prerequisite for profiling DevilutionX. ```bash sudo apt install libgoogle-perftools-dev ``` -------------------------------- ### Configure Linux Packaging Source: https://github.com/diasurgical/devilutionx/blob/master/CMakeLists.txt Sets up Linux packaging, including desktop file installation and asset deployment. ```cmake elseif(CMAKE_SYSTEM_NAME STREQUAL "Linux") string(TOLOWER ${PROJECT_NAME} project_name) set(CPACK_PACKAGE_NAME ${project_name}) set(CPACK_GENERATOR "7Z") # Common *nix files set(CPACK_STRIP_FILES TRUE) install(TARGETS ${BIN_TARGET} DESTINATION bin) set(desktop_file "${PROJECT_SOURCE_DIR}/Packaging/nix/${project_name}.desktop") set(desktop_file_hellfire "${PROJECT_SOURCE_DIR}/Packaging/nix/${project_name}-hellfire.desktop") find_program(DFI desktop-file-install) if(DFI) execute_process(COMMAND ${DFI} --dir=${CMAKE_BINARY_DIR} ${desktop_file}) set(desktop_file "${CMAKE_BINARY_DIR}/${project_name}.desktop") execute_process(COMMAND ${DFI} --dir=${CMAKE_BINARY_DIR} ${desktop_file_hellfire}) set(desktop_file_hellfire "${CMAKE_BINARY_DIR}/${project_name}-hellfire.desktop") endif() install(FILES "${desktop_file}" DESTINATION "share/applications" ) install(FILES "${desktop_file_hellfire}" DESTINATION "share/applications" ) install(FILES "${PROJECT_SOURCE_DIR}/Packaging/nix/README.txt" DESTINATION "share/diasurgical/${project_name}" ) install(FILES "${DEVILUTIONX_MPQ}" DESTINATION "share/diasurgical/${project_name}" ) install(FILES "${HELLFIRE_MPQ}" DESTINATION "share/diasurgical/${project_name}" ) ``` -------------------------------- ### Prepare DOS Build Environment Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Run this script to install or compile the necessary dependencies for building DevilutionX for DOS using DJGPP on Linux. ```bash Packaging/windows/dos-prep.sh ``` -------------------------------- ### Install pprof for Profile Visualization Source: https://github.com/diasurgical/devilutionx/blob/master/docs/profiling-linux.md Installs pprof, a powerful tool for visualizing profiling data, including flame graphs and source annotation. It is recommended for in-depth analysis. ```bash go install github.com/google/pprof@latest ``` -------------------------------- ### Install innoextract Dependencies on Ubuntu Source: https://github.com/diasurgical/devilutionx/wiki/Extracting-MPQs-from-the-GoG-installer Installs the required build tools and libraries for compiling innoextract on Ubuntu systems. Ensure you have root privileges. ```bash sudo apt install build-essential cmake libboost-all-dev liblzma-dev ``` -------------------------------- ### Clone DevilutionX repository Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Install git and clone the source code in a WSL terminal. ```bash sudo apt-get install git git clone https://github.com/diasurgical/devilutionx cd devilutionx ``` -------------------------------- ### Install vcpkg for Visual Studio Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Installs vcpkg, a C++ package manager, and integrates it with Visual Studio for dependency management. ```bat git clone https://github.com/microsoft/vcpkg cd vcpkg bootstrap-vcpkg.bat vcpkg integrate install ``` -------------------------------- ### Install Tolk Dependencies Source: https://github.com/diasurgical/devilutionx/blob/master/3rdParty/tolk/CMakeLists.txt Detects architecture and installs the appropriate Tolk DLLs and INI files to the destination directory. ```cmake if(CMAKE_SIZEOF_VOID_P EQUAL 4) set(TOLK_LIB_DIR "${Tolk_SOURCE_DIR}/libs/x86") else() set(TOLK_LIB_DIR "${Tolk_SOURCE_DIR}/libs/x64") endif() file(GLOB TOLK_DLLS LIST_DIRECTORIES false "${TOLK_LIB_DIR}/*.dll" "${TOLK_LIB_DIR}/*.ini") foreach(_TOLK_DLL_PATH ${TOLK_DLLS}) install(FILES "${_TOLK_DLL_PATH}" DESTINATION "." ) endforeach() ``` -------------------------------- ### Run DevilutionX to Generate Heap Profile Source: https://github.com/diasurgical/devilutionx/blob/master/docs/profiling-linux.md Starts the DevilutionX executable built with heap profiling enabled. This action will generate a heap profile file (`main.0001.heap`) upon loading a game. ```bash build-gperf/devilutionx ``` -------------------------------- ### Building DevilutionX from Source Source: https://context7.com/diasurgical/devilutionx/llms.txt Commands to install dependencies and compile the project using CMake across various platforms including Linux, macOS, Windows, Switch, and iOS. ```bash # Linux (Debian/Ubuntu) - Install dependencies sudo apt-get install cmake g++ libsdl2-dev libsodium-dev libpng-dev libbz2-dev \ libgtest-dev libgmock-dev libbenchmark-dev libsdl2-image-dev libfmt-dev # Build DevilutionX cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release cmake --build build -j $(getconf _NPROCESSORS_ONLN) # macOS - Install dependencies with Homebrew brew bundle install cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release cmake --build build -j $(sysctl -n hw.physicalcpu) # Windows MinGW 64-bit - Prepare dependencies Packaging/windows/mingw-prep64.sh # Configure and build with Discord integration cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/mingwcc64.toolchain.cmake \ -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DDEVILUTIONX_SYSTEM_BZIP2=OFF \ -DDEVILUTIONX_STATIC_LIBSODIUM=ON -DDISCORD_INTEGRATION=ON cmake --build build -j $(getconf _NPROCESSORS_ONLN) --target package # Nintendo Switch cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake \ -DCMAKE_BUILD_TYPE=Release -DBUILD_ASSETS_MPQ=ON cmake --build build -j $(getconf _NPROCESSORS_ONLN) # iOS cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=../CMake/Platforms/ios.toolchain.cmake \ -DENABLE_BITCODE=0 -DPLATFORM=OS64 cmake --build build -j $(sysctl -n hw.physicalcpu) --config Release ``` -------------------------------- ### Install innoextract on iOS Source: https://github.com/diasurgical/devilutionx/wiki/Extracting-MPQs-from-the-GoG-installer Use this command to install the innoextract utility within the iSH shell on iOS. This tool is required for extracting game data. ```bash apk add innoextract ``` -------------------------------- ### Check innoextract Version Source: https://github.com/diasurgical/devilutionx/wiki/Extracting-MPQs-from-the-GoG-installer Verifies the installed version of innoextract. Version 1.8 or higher is required for extracting MPQ files from the GOG Diablo installer. ```bash innoextract --version ``` -------------------------------- ### Build DevilutionX on macOS Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Install dependencies via Homebrew and compile using CMake. ```bash brew bundle install cmake -S. -Bbuild -DCMAKE_BUILD_TYPE=Release cmake --build build -j $(sysctl -n hw.physicalcpu) ``` -------------------------------- ### Variable Usage Examples Source: https://github.com/diasurgical/devilutionx/blob/master/Translations/glossary.md Demonstrates the correct and incorrect ordering of variables within translation strings. ```text %s' (level %i) just joined the game ``` ```text %s' (level %i) is now with you. ``` ```text A level %i Character named % s' is now with you. ``` -------------------------------- ### Run DevilutionX Amiga Build Interactively in Docker Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Starts an interactive Docker session to build DevilutionX for Amiga, allowing for custom build options. ```bash docker run -u "$(id -u "$USER"):$(id -g "$USER")" -ti --rm -v "${PWD}:/work" devilutionx-amiga bash ``` -------------------------------- ### Build DevilutionX for PS5 Source: https://github.com/diasurgical/devilutionx/blob/master/Packaging/ps5/README.md Execute the build script after installing the PacBrew PS5 SDK. ```console devilutionX$ ./Packaging/ps5/build.sh ``` -------------------------------- ### Run GDBServer on RG99 for Remote Debugging Source: https://github.com/diasurgical/devilutionx/blob/master/Packaging/OpenDingux/rg99-pgo.md On the RG99, set up demo files and start the `gdbserver` to listen for incoming debugger connections. Ensure the correct DevilutionX executable and arguments are used. ```sh mkdir -p demo cp -r squashfs-root/demo_0* demo cp -r squashfs-root/spawn_0_sv demo cd squashfs-root gdbserver 10.1.1.1:8001 devilutionx --diablo --spawn --demo 0 --timedemo \ --save-dir ~/demo --data-dir ~/.local/share/diasurgical/devilution ``` -------------------------------- ### Install Python Packages for Segmenter Source: https://github.com/diasurgical/devilutionx/blob/master/tools/segmenter/README.md Installs the necessary Python packages for the segmenter tool. Ensure you have Python and pip installed and that the Python version is compatible with TensorFlow. ```shell pip install --upgrade -r tools/segmenter/requirements.txt ``` -------------------------------- ### Running DevilutionX with Arguments on Windows Source: https://github.com/diasurgical/devilutionx/wiki/Launching-with-Additional-Arguments Instructions on how to apply command-line arguments when running DevilutionX on Windows using batch files or shortcuts. ```APIDOC ## Using a Batch File 1. **Create a Text File**: In your DevilutionX folder, create a new text file. 2. **Enter Commands**: Open the file in a text editor and enter the name of the DevilutionX executable followed by the desired arguments. For example: `devilutionx.exe --data-dir "C:\DevilutionX" --save-dir "C:\DevilutionX\Saves"` 3. **Save the File**: Save the file and then rename its extension from .txt to .bat. 4. **Run the Script**: Double-click the .bat file to start the game with the specified arguments. ## Using a Shortcut 1. Right-click on the DevilutionX executable and select "Create Shortcut." 2. Right-click on the shortcut and select "Properties." 3. Under the "Shortcut" tab, in the "Target" field, add the desired arguments and paths after the path to the executable. For example: `C:\DevilutionX\devilutionx.exe -n -f --diablo` 4. Use the shortcut to start the game. ``` -------------------------------- ### Configure and Build Asio with CMake Source: https://github.com/diasurgical/devilutionx/blob/master/3rdParty/asio/CMakeLists.txt Downloads the Asio library and sets up the static library target with necessary compile definitions and include paths. ```cmake include(functions/FetchContent_ExcludeFromAll_backport) include(FetchContent) FetchContent_Declare_ExcludeFromAll(asio URL https://github.com/diasurgical/asio/archive/4bcf552fcea3e1ae555dde2ab33bc9fa6770da4d.tar.gz URL_HASH MD5=7ffee993fc21b1115abf485958d03ac8 ) FetchContent_MakeAvailable_ExcludeFromAll(asio) add_library(asio STATIC ${CMAKE_CURRENT_LIST_DIR}/asio_handle_exception.cpp) target_compile_definitions(asio PUBLIC ASIO_NO_EXCEPTIONS) target_include_directories(asio PUBLIC ${asio_SOURCE_DIR}/asio/include ${CMAKE_CURRENT_LIST_DIR}) if(NINTENDO_3DS OR NINTENDO_SWITCH) include(asio_defs REQUIRED) endif() ``` -------------------------------- ### Manual Benchmark Execution Workflow Source: https://github.com/diasurgical/devilutionx/blob/master/docs/benchmarking.md Demonstrates the manual steps performed by the build_and_run_benchmark script, including CMake configuration and build. ```bash { [ -d build-reld ] || cmake -S. -Bbuild-reld -DCMAKE_BUILD_TYPE=RelWithDebInfo; } && \ cmake --build build-reld --target clx_render_benchmark && \ tools/linux_reduced_cpu_variance_run.sh build-reld/clx_render_benchmark ``` -------------------------------- ### Terminology Coherence Examples Source: https://github.com/diasurgical/devilutionx/blob/master/Translations/glossary.md Examples of consistent versus inconsistent terminology usage for game actions. ```text fully recover life recover life fully recover mana recover mana ``` ```text recover all life points recover partial life fully recover mana recover mana ``` -------------------------------- ### Enable CWD LLDB Initialization Source: https://github.com/diasurgical/devilutionx/blob/master/tools/lldb/README.md Allows LLDB to load the .lldbinit file from the current working directory. ```text settings set target.load-cwd-lldbinit true ``` -------------------------------- ### Fetch and Configure Tolk Library Source: https://github.com/diasurgical/devilutionx/blob/master/3rdParty/tolk/CMakeLists.txt Downloads the Tolk library using FetchContent and sets up include directories for the project. ```cmake include(functions/FetchContent_ExcludeFromAll_backport) # Workaround for deprecation of older CMake versions set(CMAKE_POLICY_VERSION_MINIMUM 3.22) include(FetchContent) FetchContent_Declare_ExcludeFromAll(Tolk URL https://github.com/sig-a11y/tolk/archive/89de98779e3b6365dc1688538d5de4ecba3fdbab.tar.gz URL_HASH MD5=724f6022186573dd9c5c2c92ed9e21e6 ) FetchContent_MakeAvailable_ExcludeFromAll(Tolk) target_include_directories(Tolk PUBLIC ${libTolk_SOURCE_DIR}/src) ``` -------------------------------- ### Disable Installation of Googletest Source: https://github.com/diasurgical/devilutionx/blob/master/3rdParty/googletest/CMakeLists.txt Set INSTALL_GTEST to OFF to prevent googletest from being installed as part of the main project build. ```cmake set(INSTALL_GTEST OFF) ``` -------------------------------- ### Hungarian notation variable examples Source: https://github.com/diasurgical/devilutionx/wiki/Code-Style Examples of Hungarian notation used for specific globals and parameters in the project. ```cpp uint8_t bLen; bool isEnabled; uint16_t wLen; uint32_t dwLen; size_t nLen; static bool sgbSomeFlag; static uint32_t sgdwSomeDword; ``` -------------------------------- ### Prepare MinGW 64-bit Dependencies Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Downloads and prepares 64-bit development libraries for SDL2 and libsodium, along with zlib headers, for MinGW. ```bash Packaging/windows/mingw-prep64.sh ``` -------------------------------- ### Run GDB with auto-load safe path Source: https://github.com/diasurgical/devilutionx/blob/master/tools/gdb/README.md Use this command to safely load the .gdbinit file from the current directory. ```bash gdb -iex 'add-auto-load-safe-path .' build/devilutionx ``` -------------------------------- ### Prepare MinGW 32-bit Dependencies Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Downloads and prepares 32-bit development libraries for SDL2 and libsodium, along with zlib headers, for MinGW. ```bash Packaging/windows/mingw-prep.sh ``` -------------------------------- ### Configure VS Code LLDB Initialization Source: https://github.com/diasurgical/devilutionx/blob/master/tools/lldb/README.md Adds the initialization command to the VS Code launch configuration to source the project-specific .lldbinit file. ```json "lldb.launch.initCommands": ["command source ${workspaceFolder}/.lldbinit"] ``` -------------------------------- ### Install SDL2 Debugging Symbols Source: https://github.com/diasurgical/devilutionx/blob/master/docs/profiling-linux.md Installs debugging symbols for the SDL2 library, which can be helpful when debugging performance issues related to graphics or input. ```bash sudo apt install libsdl2-dev-dbgsym ``` -------------------------------- ### Configure FetchContent and Build Flags Source: https://github.com/diasurgical/devilutionx/blob/master/3rdParty/SheenBidi/CMakeLists.txt Sets initial build flags and declares the SheenBidi dependency for the project. ```cmake include(functions/FetchContent_ExcludeFromAll_backport) include(FetchContent) set(BUILD_TESTING OFF) set(ASAN OFF) set(UBSAN OFF) FetchContent_Declare_ExcludeFromAll(SheenBidi URL https://github.com/Tehreer/SheenBidi/archive/refs/tags/v2.9.0.tar.gz URL_HASH MD5=2c22cfad93a52afa7bd25ad56a3a4089 ) FetchContent_MakeAvailable_ExcludeFromAll(SheenBidi) ``` -------------------------------- ### Configure and Build DevilutionX (MinGW 64-bit) Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Configures the project for 64-bit MinGW, disabling tests, statically linking libraries, and enabling Discord integration. Then, builds the package for distribution. ```bash cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/mingwcc64.toolchain.cmake \ -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DDEVILUTIONX_SYSTEM_BZIP2=OFF \ -DDEVILUTIONX_STATIC_LIBSODIUM=ON -DDISCORD_INTEGRATION=ON ``` ```bash cmake --build build -j $(getconf _NPROCESSORS_ONLN) --target package ``` -------------------------------- ### Install Python for macOS 10.4 Tiger Tools Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Install Python 3.12 and set it as the default Python interpreter for running tools from the 'tools/' directory on macOS 10.4 Tiger. ```bash sudo port install python312 sudo port select --set python python312 sudo port select --set python3 python312 ``` -------------------------------- ### Install macOS 10.4 Tiger Dependencies with MacPorts Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Install necessary packages for compiling DevilutionX on macOS 10.4 Tiger using MacPorts. Some packages might require manual deactivation/reactivation. ```bash sudo port install curl curl-ca-bundle gcc14 cmake \ libsdl12 libsdl_image libsodium bzip2 zlib lua54 ``` ```bash # Set GCC 14 as the default GCC: sudo port select --set gcc mp-gcc14 ``` -------------------------------- ### Configure and Build DevilutionX (MinGW 32-bit) Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Configures the project for 32-bit MinGW, disabling tests, statically linking libraries, and enabling Discord integration. Then, builds the package for distribution. ```bash cmake -S. -Bbuild -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/mingwcc.toolchain.cmake \ -DCMAKE_BUILD_TYPE=Release -DBUILD_TESTING=OFF -DDEVILUTIONX_SYSTEM_BZIP2=OFF \ -DDEVILUTIONX_STATIC_LIBSODIUM=ON -DDISCORD_INTEGRATION=ON ``` ```bash cmake --build build -j $(getconf _NPROCESSORS_ONLN) --target package ``` -------------------------------- ### Build DevilutionX for Miyoo Mini Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Run this shell script from within the Toolchain Docker image to build DevilutionX for Miyoo Mini. The output is placed in build-miyoo-mini/SDROOT. ```shell Packaging/miyoo_mini/build.sh ``` -------------------------------- ### Create Diablo 1 Data Symlink Source: https://github.com/diasurgical/devilutionx/blob/master/docs/manual/platforms/rg350.md Use this bash command to create a symbolic link for the `diabdat.mpq` file if it's stored on an SD card. This ensures DevilutionX can find the game data. ```bash ln -sf /media/sdcard/ /media/home/.local/share/diasurgical/devilution/diabdat.mpq ``` -------------------------------- ### Cross-Compilation CMake Toolchain Examples Source: https://context7.com/diasurgical/devilutionx/llms.txt Specify toolchain files for cross-compiling DevilutionX to various target platforms. ```bash cmake -S. -Bbuild \ -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/aarch64-linux-gnu.toolchain.cmake ``` ```bash cmake -S. -Bbuild \ -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/mingwcc.toolchain.cmake ``` ```bash cmake -S. -Bbuild \ -DCMAKE_TOOLCHAIN_FILE=../CMake/platforms/mingwcc64.toolchain.cmake ``` ```bash cmake -S. -Bbuild \ -DCMAKE_TOOLCHAIN_FILE=/opt/devkitpro/cmake/Switch.cmake \ -DBUILD_ASSETS_MPQ=ON ``` ```bash cmake -S. -Bbuild \ -DCMAKE_TOOLCHAIN_FILE=${VITASDK}/share/vita.toolchain.cmake ``` ```bash cmake -S. -Bbuild \ -DCMAKE_TOOLCHAIN_FILE=../CMake/Platforms/ios.toolchain.cmake \ -DENABLE_BITCODE=0 -DPLATFORM=OS64 ``` -------------------------------- ### Fetch and Declare Google Benchmark Dependency Source: https://github.com/diasurgical/devilutionx/blob/master/3rdParty/benchmark/CMakeLists.txt Use FetchContent to declare and download the Google Benchmark library. Ensure the URL and hash are correct for reproducible builds. ```cmake include(functions/FetchContent_ExcludeFromAll_backport) FetchContent_Declare_ExcludeFromAll( benchmark URL https://github.com/google/benchmark/archive/refs/tags/v1.8.5.tar.gz URL_HASH MD5=708d91ce255e8af4c1d7dfec50dff178 ) FetchContent_MakeAvailable_ExcludeFromAll(benchmark) ``` -------------------------------- ### Compile DevilutionX with Emscripten Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Compiles DevilutionX for web deployment using Emscripten. Requires Emscripten SDK installation. ```bash emcmake cmake -S. -Bbuild-em -DCMAKE_BUILD_TYPE=Release cmake --build build-em -j $(getconf _NPROCESSORS_ONLN) ``` -------------------------------- ### Build DevilutionX for Clockwork PI GameShell Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Builds DevilutionX for Clockwork PI GameShell, including dependency installation. ```bash Packaging/cpi-gamesh/build.sh ``` -------------------------------- ### Cathedral Dungeon Generation Debug Info Source: https://github.com/diasurgical/devilutionx/blob/master/docs/BACKGROUND.md Example of debug symbol information recovered from the Japanese Playstation port. ```cpp // address: 0x801259D0 // line start: 612 // line end: 624 void DRLG_L1Floor__Fv() { // register: 19 register int i; // register: 20 register int j; // register: 3 register long rv; } ``` -------------------------------- ### Build DevilutionX for OpenDingux/RetroFW Source: https://github.com/diasurgical/devilutionx/blob/master/docs/building.md Builds DevilutionX packages for OpenDingux and RetroFW using a specified toolchain. Ensure 'mksquashfs' is installed. ```bash TOOLCHAIN= Packaging/OpenDingux/build.sh ``` -------------------------------- ### Declare and Fetch External Project (mpqfs) Source: https://github.com/diasurgical/devilutionx/blob/master/3rdParty/mpqfs/CMakeLists.txt Use FetchContent to declare and download the mpqfs Git repository. Ensure the correct Git tag is specified for reproducible builds. This is typically used when a dependency is not available as a pre-built library or needs to be compiled from source. ```cmake include(FetchContent) FetchContent_Declare(mpqfs GIT_REPOSITORY https://github.com/diasurgical/mpqfs.git GIT_TAG 952490b991887cd11584e0042a06787b242eeec7 ) FetchContent_MakeAvailable(mpqfs) ```