-
Notifications
You must be signed in to change notification settings - Fork 13
Compiling EDGE‐Classic
Download the Visual Studio Build Tools Installer and install the 'Desktop Development with C++' Workload
- Also select the "C++ CMake tools for Windows" optional component
Install VSCode as well as the C/C++ and CMake Tools Extensions
After opening the project folder in VSCode, select the 'Visual Studio Build Tools (version) Release - x86_amd64' kit for 64-bit, or the x86 kit for 32-bit
Select the Release CMake build variant
Click Build
This section assumes that you have completed the steps at https://www.msys2.org/ and have a working basic MSYS2 install
From an MSYS prompt for your target architecture:
Install the following additional packages:
-
mingw-w64-(arch)-gcc
(if not performed during initial MSYS2 install/setup) mingw-w64-(arch)-cmake
mingw-w64-(arch)-SDL2
Then, after navigating to the project directory:
> cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-static -lmingw32 -lSDL2main -lSDL2.dll -mwindows" -DCMAKE_C_COMPILER_WORKS=1 -DCMAKE_CXX_COMPILER_WORKS=1
> cmake --build build (-j# optional, with # being the number of threads/cores you'd like to use)
> strip edge-classic.exe (if desired)
WARNING: w64devkit's bundled tools such as GNU Make can produce false positives in Windows Defender; please see https://github.com/skeeto/w64devkit/issues/79 for more information and steps to validate that the Make executable is valid. Any Windows Defender exceptions that are created to account for this are the responsibility of the user and the user alone, and are NOT recommended actions by the development team!
NOTE: Windows XP support has been deprecated; the steps below may fail with future versions of EDGE-Classic. Issues that prevent EDGE-Classic from running in Windows XP outside of legitimate bugs (i.e., an otherwise good function needs compiler defines and a separate code path to work with XP) will not be addressed by the development team.
This section assumes that you have downloaded the i686
release from https://github.com/skeeto/w64devkit/releases and extracted it to a folder of your choosing. You will also need to download the SDL2-devel-<version>-mingw
package from https://github.com/libsdl-org/SDL/releases/latest and placed the contents of its i686-w64-mingw32
folder into the i686-w64-mingw32
folder of your w64devkit installation.
Launch w64devkit.exe from your extracted w64devkit folder.
Then, after navigating to the project directory:
> cmake -B build -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXE_LINKER_FLAGS="-static -lmingw32 -lSDL2main -lSDL2.dll -mwindows" -DCMAKE_C_COMPILER_WORKS=1 -DCMAKE_CXX_COMPILER_WORKS=1
> cmake --build build (-j# optional, with # being the number of threads/cores you'd like to use)
> strip edge-classic.exe (if desired)
This section assumes that you have a display server and graphical environment installed
Install the following packages with their dependencies (exact names may vary based on distribution):
cmake
g++
libsdl2-dev
Then, after navigating to the project directory in a terminal:
> cmake -B build -DCMAKE_BUILD_TYPE=Release
> cmake --build build (-j# optional, with # being the number of threads/cores you'd like to use)
This section assumes that you have a display server and graphical environment installed
Install the following packages with their dependencies (exact names may vary based on distribution):
cmake
sdl2
Then, after navigating to the project directory in a terminal:
> cmake -B build -DCMAKE_BUILD_TYPE=Release
> cmake --build build (-j# optional, with # being the number of threads/cores you'd like to use)
Please note, the web version is less mature than other platforms and there is ongoing work to better integrate it.
In order to build for the web you'll need:
cmake
-
python3
- (Required by Emscripten) -
Emscripten
- Download and install the Emscripten SDK
Before building, copy an IWAD such as freedoom2.wad to the example website template in the project's root /web/preload
folder, if you are using an IWAD other than freedoom2.wad, edit /web/site/index.html
accordingly.
You can add other WAD files to the preload folder. For example, to play Arctic Wolf: Revisited, copy the WAD and then modify the arguments list in index.html
adding "-file", "arctre.wad"
When adding files to the preload folder, building is required as the data is processed to be loaded by browser.
Now, configure and build:
> cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE=C:/emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake -G "Unix Makefiles"
> cmake --build build (-j# optional, with # being the number of threads/cores you'd like to use)
Once the build is complete, all the required files should be in the /web/site
folder, change directory to this folder and run python -m http.server
Open a web browser, navigate to http://127.0.0.1:8000
, and play Edge Classic!
In all cases (barring the WebGL build per the previous section), the executable will be copied to the root of the project folder upon success. You can either launch the program in place, or copy the following folders and files to a separate directory if desired:
- autoload
- edge_base
- edge_fixes
- soundfont
- edge-classic/edge-classic.exe (OS-dependent)
- edge_defs.epk
- SDL2.dll (Windows-only, MSYS and w64devkit builds must have this file moved here manually; see below instructions for details)
MSYS BUILDS: You will need to navigate to the /bin folder for the appropriate architecture in your MSYS2 installation (for example, /mingw64/bin for MinGW 64-bit builds), and copy SDL2.dll into the same directory as edge-classic.exe. If the program has errors on startup regarding other .dlls missing, they can be found in this location as well.
W64DEVKIT BUILDS: You will need to copy SDL2.dll from the /i686-w64-mingw32/bin of your w64devkit install to the directory containing edge-classic.exe