Skip to content

Project Layout

Karn Kaul edited this page Oct 6, 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 build subdirectories within Source and prevent those 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/
    Source/                   # All source code
        .CMake/
        ThirdParty/
            Include/          # All library headers
            physfs/
            [SFML/]           # Downloaded during ThirdParty configuration (ignored)
            CMakeLists.txt    # Top level for ThirdParty
        Core
        Engine
        Game
        App
        CMakeLists.txt        # Top level for LittleEngine
    {Runtime/}                  # Debugging working directory (ignored with exceptions)
        {GameAssets/}         # Assets root directory (ignored with exceptions)
            *.amf             # Cook-time and runtime manifest(s)
        [GameMusic/]          # Music (streamed) root directory (ignored)
        Utils/                # Tools scripts and packaging resources
        [GameAssets.cooked]   # Cooked assets (ignored)
    [Project*/]               # IDE directories (ignored)
    [_Build/]                 # Build path for executables, libraries and third party dependencies (ignored)
        [CI/]                 # Local CI projects and builds go here (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.)
Engine All Engine code: Context, Audio, Input, Physics, Renderer, Repository, etc.
Game All game-specific code, including Model, Framework, and Gameplay.
App OS-specific application resources and main().

Note: A few features in Core are fully isolated and are available as standalone repositories for use with other projects: they are integrated into LittleEngine as Git submodules; without them the project cannot be built.

Build Configurations

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

(Win64, non-MinGW) Note: ``ThirdPartylibraries will be built as Debug/Release according to the CRT being linked with, and the compiler configuration for it must be identical across all projects inLittleEngine` (`/MDd` vs `/MD`).

Clone this wiki locally