Building the Editor

The Editor is a standalone CMake executable target that links against the Core engine library and bundles Dear ImGui for its interface.

CMake Target

The Editor target is defined in SafiEngine/editor/CMakeLists.txt:

add_executable(Editor ${EDITOR_SOURCES})

Sources are collected via GLOB_RECURSE from editor/src/.

Dependencies

DependencySource
Core (SafiEngine)Engine library with ECS, rendering, physics, audio, native scripting
Dear ImGuiDocking branch, bundled as a static library in editor/third_party/imgui/
GLFWWindowing and input (fetched via FetchContent)
OpenGLRendering backend

The Core library itself pulls in:

  • Flecs v4.0.5 (ECS)
  • tinygltf v2.9.5 (glTF loader)
  • GLM 1.0.1 (math)
  • nlohmann/json v3.11.3 (serialization)
  • Jolt Physics v5.2.0
  • miniaudio 0.11.22 (audio)
  • Native C++ Behavior system (scripting)

Build Commands

# Configure
cmake -B build -S SafiEngine

# Build
cmake --build build --target Editor

The C++ standard is C++17 (required for std::filesystem).

Post-Build Steps

The CMake configuration includes two post-build copy steps:

  1. Editor assets — Copies editor/assets/ to the output directory (assets/). This includes template files like Player.glb used by the 3D Starter project template.

  2. Core shaders — Copies Core/assets/shaders/ to the output directory (shaders/). These are the vertex, fragment, and utility shaders required by the renderer.

Platform Notes

PlatformNotes
macOSDefines GL_SILENCE_DEPRECATION, links OpenGL framework. Native file dialogs via osascript.
Linux / WindowsLinks OpenGL library. File dialogs fall back to default paths.