A program that visualizes the process of generating and solving mazes.
The executable is in the build directory.
Run with help to see the program's parameters.
# Windows release build
.\build\Windows\release\run\maze_engine.exe help
# Windows debug build
.\build\Windows\debug\run\maze_engine.exe help# Linux release build
./build/Linux/release/run/maze_engine help
# Linux debug build
/build/Linux/debug/run/maze_engine helpTo build, you need to install the neccessary dependencies for your platform.
Running scons on the command-line will build the default target, which is the release build for your native platform, build/<platform>/release/run/maze_engine<file_extension>.
To build all available targets—including the test suite and the JSON compilation database—run scons . on the command-line.
The test suite executable is put at build/<platform>/<build_type>/run/test_suite<file_extension>.
The JSON compilation database is put at build/<platform>/<build_type>/compile_commands.json. You can configure Visual Studio Code to use this database with the Microsoft C++ extension, for example:
.vscode/c_cpp_properties.json
{
"configurations": [
{
"name": "Win32",
"compileCommands": "build\\Windows\\debug\\compile_commands.json",
"cStandard": "c17", "cppStandard": "c++17"
},
{
"name": "Linux",
"compileCommands": "build/Linux/debug/compile_commands.json",
"cStandard": "c17", "cppStandard": "c++17"
},
{
"name": "emscripten",
"compileCommands": "build/web/release/compile_commands.json",
"cStandard": "c17", "cppStandard": "c++17"
}
],
"version": 4
}Also, if you would like to build a specific file,
you can run scons <file> where <file> is a file you want to build.
For example, to build only the compilation database for the debug build on Windows,
you would run this:
scons .\build\Windows\debug\compile_commands.jsonTo clean the build, run scons -c or scons -c ., for the default target or all targets, respectively.
Note: If you want to move the Windows executable
maze_engine.exeto a different location, moveSDL2.dllandSDL2_mixer.dllalong with it to the same directory. The executable needs those dynamic-link libraries to run.
The following are the C++ compilers that can build successfully for each platform. Other untested C++ compilers may work.
The Windows build uses the command-line toolset from the Build Tools for Visual Studio.
This project builds with g++.
This project uses SCons as its build system, so Python is required to build it.
SCons and other Python dependencies are listed in requirements.txt at the root of the project. You can use pip to install them.
Windows usually uses
pyfor Python.
py -m pip install --requirement requirements.txtLinux usually uses
python3for Python.
python3 -m pip install --requirement requirements.txtThis project requires SDL. The method of downloading SDL depends on the platform.
Run the fetch_libraries.py Python script from the root of the project to fetch the SDL2 library for Windows. This script fetches and unpacks the main SDL2 library from the SDL releases on GitHub and the SDL2 Mixer library from the SDL Mixer releases on GitHub.
py fetch_libraries.pyThese commands are copied from the official SDL installation guide.
Debian-based systems (including Ubuntu):
sudo apt-get install libsdl2-devRed Hat-based systems (including Fedora):
sudo dnf install SDL2-develGentoo:
sudo emerge libsdl2