Engine

Building the Project

Instructions on how to build Nevo Engine using CMake and build scripts.

Prerequisites

Before building Nevo Engine, ensure you have the following installed on your Linux system:

  • CMake (3.18 or higher)
  • Ninja or Make
  • C++ Compiler (GCC or Clang with C++20 support)
  • GLEW, GLFW3, and OpenGL development libraries

Using the Build Script

The easiest way to build the engine is to use the provided build.sh script.

Default Build (Release)

./build.sh

Debug Build

./build.sh --debug

Clean Build

./build.sh --clean

Other Options

  • --reldeb: Optimized build with debug symbols.
  • -v, --verbose: Enable verbose output from the build system.
  • -b, --build-dir: Specify a custom build directory.

Manual Build with CMake

If you prefer to use CMake directly:

  1. Create a build directory:
    mkdir build && cd build
  2. Configure the project:
    cmake .. -DCMAKE_BUILD_TYPE=Release
  3. Build the engine:
    cmake --build . --target nevo_engine

Build Optimizations

The CMakeLists.txt is configured with several optimizations for performance:

  • Unity Builds: Enabled to reduce compiler overhead by grouping source files.
  • Mold Linker: Automatically used if available for significantly faster linking.
  • LTO (Link Time Optimization): Enabled for Release builds.
  • Aggressive Optimization: Uses -O3, -ffast-math, and -funroll-loops in Release mode.

Artifacts

After a successful build, the shared library (libnevo_engine.so) will be located in the build directory. The build.sh script also automatically deploys the library and necessary headers to neighboring projects (e.g., ../Nevo-base).