Skip to content

Project Layout

Karn Kaul edited this page Nov 4, 2019 · 4 revisions

Project Layout

Introduction

There are a few core design goals that LittleEngine strives to stick to / achieve, which result in most of the structural decisions around the project.

Executable

  1. Portable: should not require any special paths to run (CMake install stage updates RPATHs)
  2. Flexible: should not require to be run from any specific working directory (the application attempts to figure out its own working directory at runtime)
  3. Standalone: should have minimum external dependencies (static libs / app bundles where possible)
  4. Self-contained: all executable dependencies must be located in the same directory as itself (or its subdirectories)
  5. GUI friendly: should launch when interacted with from the OS explorer / finder / etc, and should embed icon and version info (each OS has its own implementation)
  6. Monolithic: releases should contain all necessary files and a single installer for all supported platforms

Development

  1. Platform-independent: should be possible to build on all possible platforms (of course, limited by ThirdParty compatibility)
  2. Tools-independent: should not enforce any specific IDE / toolchain / compiler (except on MacOSX)
  3. Fast: builds should be as fast as possible (hence the recommendation to use ninja; the use of forward declarations; preference towards large number of small code files; etc)
  4. Develop Configuration: should use Release libs but be unoptimised and have all debugging features, including filesystem assets
  5. Cross-platform tools: all tools scripts should be in Bash / Python for maximum compatibility

Source Tree

LittleEngine follows a relatively strict directory structure, intended to ease continuous development and contribution. In general, in-source builds are not permitted, and CMake scripts will attempt to detect and prevent such configurations from succeeding as well. All unsuccessful CMake configurations leave behind some build artefacts (CMakeCache.txt and CMakeFiles/), which must be manually cleaned up.

Directory structure:

LittleEngine/
    .travis/
    .CMake/
    ThirdParty/
        Include/          # All library headers
        physfs/
        [SFML/]           # Downloaded during ThirdParty configuration (ignored)
        CMakeLists.txt    # Top level for ThirdParty
    Core/
    Engine/
    Test/                 # Test executable project
    ThirdParty/           # Third party libraries source root
    Tools/                # Misc tools scripts
    CMakeLists.txt        # Top level for LittleEngine
[out/*]                   # CMake build directories (ignored)

Sub-projects

A short description of each sub-project / target of LittleEngine:

Project Description
ThirdParty All dependencies that are built from source, like PhysicsFS and SFML.
Core Core structures and utilities used by all projects. (Core contains a few submodules.)
LittleEngine All Engine code: Context, Audio, Input, Physics, Renderer, Repository, etc.

Build Configurations

Config | MSVCRT | Libraries | DEBUGGING | SHIPPING | Optimisation | Disk Assets -------|--------|-----------|----------|--------------|-------------- Debug | CRTd | Debug | True | False | Od/O0 | True Release | CRT | Release | False | True | O2 | False

Clone this wiki locally