Skip to main content

Building Eglantine

For Developers Only

This guide is intended for developers ONLY. If you are not a developer or packager, you are unlikely to receive support.

This is a guide to building Eglantine on Windows, Linux, and macOS.

If you already have a development environment set up:

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel

Read the Dependencies guide for platform requirements. Android has a separate build process.

Dependencies​

First, you must install some dependencies.

Clone​

Next, you will want to clone Eglantine via the terminal:

git clone https://github.com/Djihads80/Eglantine.git
cd Eglantine

Or use Qt Creator (Create Project -> Import Project -> Git Clone).

Android​

Android has a completely different build process than other platforms. See its dedicated page.

Initial Configuration​

If the configure phase fails, see the Troubleshooting section below. Usually, as long as you followed the dependencies guide, the defaults should successfully configure and build.

Option A: Qt Creator​

This is the recommended GUI method for Linux, macOS, and Windows.

Click to Open

[!WARNING] On MSYS2, to use Qt Creator you are recommended to also install Qt from the online installer, ensuring to select the "MinGW" version.

Open the CMakeLists.txt file in your cloned directory via File -> Open File or Project (Ctrl+O), if you didn't clone Eglantine via the project import tool.

Select your desired "kit" (usually, the default is okay). RelWithDebInfo or Release is recommended:

Qt Creator kits

Hit "Configure Project", then wait for CMake to finish configuring (may take a while on Windows).

Option B: Command Line​

Run CMake from the cloned repository. CMake and the selected build tool must be available in your PATH. The examples use Ninja; another supported generator can be selected with -G.

With MSVC, open a Visual C++ development environment first. The repository includes tools/windows/load-msvc-env.ps1 for PowerShell and tools/windows/load-msvc-env.sh for MSYS2 or Git Bash.

cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release
cmake --build build --parallel

For a clang-cl build, add -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl to the configure command.

The single-configuration build types are Debug, Release, RelWithDebInfo, and MinSizeRel. With Visual Studio generators, CMake uses multi-configuration builds instead. See the root CMakeLists.txt for available CMake options, including the architecture-specific YUZU_BUILD_PRESET.

Option C: CLion​

Click to Open
  • Clone the Repository:


Building & Setup​

  • Once Cloned, You will be taken to a prompt like the image below:

  • Set the settings to the image below:

  • Change Build type: Release

  • Change Name: Release

  • Change Toolchain Visual Studio

  • Change Generator: Let CMake decide

  • Change Build directory: build

  • Click OK; now CLion will build a directory and index your code to allow for IntelliSense. Please be patient.

  • Once this process has been completed (No loading bar bottom right), you can now build Eglantine

  • In the top right, click on the drop-down menu, select all configurations, then select Eglantine

  • Now run by clicking the play button or pressing Shift+F10, and Eglantine will auto-launch once built.

Option D: Visual Studio with clang-cl​

Click to Open
  1. Install the Visual Studio C++ tools and CMake.
  2. Open an x64 Visual C++ development environment.
  3. Configure the project with the Ninja generator and specify clang-cl as both the C and C++ compiler (see the Windows command-line tab).
  4. Open the cloned directory as a CMake project in Visual Studio and build.

Troubleshooting​

If your initial configure failed:

  • Carefully re-read the Dependencies guide
  • Clear the CPM cache (.cache/cpm) and CMake cache (<build directory>/CMakeCache.txt)
  • Evaluate the error and find any related settings
  • See the CPM docs to see if you may need to forcefully bundle any packages

Otherwise, feel free to ask for help in Stoat or Discord.

Caveats​

Many platforms have quirks, bugs, and other fun stuff that may cause issues when building OR running. See the Caveats page before continuing.

Building & Running​

Interactive configuration helper​

tools/configure.py starts from the release CI flags for your platform and lets you toggle the main build options before generating the build files:

python3 tools/configure.py
KeyAction
SpaceToggle the highlighted option
t / cCycle the build type / compiler cache
rReset to the CI defaults
EnterRun CMake to generate the build files
bConfigure and build
qQuit without configuring

Options whose prerequisite is disabled are dimmed and cannot be toggled. The defaults use Release, Ninja, the build directory, ccache when it is installed, ENABLE_UPDATE_CHECKER=ON, and the bundled-dependency flags from the CI workflows for your platform.

Non-interactive uses:

python3 tools/configure.py --list # show options and defaults
python3 tools/configure.py --dry-run # print the CMake command
python3 tools/configure.py --no-tui -B build/release
python3 tools/configure.py --no-tui --build -j 8
python3 tools/configure.py --define EGLANTINE_RELEASE_PLATFORM=linux-aarch64

On Qt Creator​

Simply hit Ctrl+B, or the "hammer" icon in the bottom left. To run, hit the "play" icon, or Ctrl+R.

On Command Line​

cmake --build build --parallel

The Qt application is built to:

  • Windows: build/bin/eglantine.exe
  • macOS: build/bin/eglantine.app/Contents/MacOS/eglantine
  • Linux: build/bin/eglantine

The optional SDL command-line frontend (YUZU_CMD, enabled by default on non-Android builds) is output as eden-cli in the same build/bin directory.

Scripts​

Take a look at our CI scripts. You can use .ci/common/configure.sh on any POSIX-compliant shell, but you are heavily encouraged to instead write your own based. It's not really that hard, provided you can read CMake.