cgride-engine is the orchestration layer of Cgride.
It connects the project model, toolchain description, build graph, executor, and cache primitives into one build flow. The engine does not print to the terminal, does not call std::exit, and does not own the CLI. It returns structured results so it can be embedded in a command-line tool, editor integration, server process, or another native application.
Cgride is built as a modular C++ build system. Each module owns a small part of the system:
cgride-coreprovides shared primitives.cgride-projectdescribes projects and targets.cgride-graphdescribes build tasks and dependencies.cgride-toolchainscreates compiler, archiver, and linker commands.cgride-executorruns graph tasks.cgride-cachestores cache metadata.cgride-engineconnects these modules into a build operation.
The engine is the first layer where these modules meet.
This module depends on:
cgride::corecgride::projectcgride::graphcgride::toolchainscgride::executorcgride::cache
It must not depend on:
cgride::configcgride::cli
This keeps the engine reusable outside the CLI.
BuildOptions describes how a build should run.
It includes:
- build directory
- selected target
- debug or release mode
- job count
- rebuild mode
- cache usage
- dry-run mode
- verbose mode
Example:
cgride::engine::BuildOptions options;
options
.build_directory("build")
.target("app")
.mode(cgride::engine::BuildMode::Release)
.jobs(8)
.use_cache(true)
.verbose(true);BuildRequest is the complete input required by the engine.
It combines:
- a
cgride::project::Project - a
cgride::toolchains::Toolchain BuildOptions
Example:
cgride::engine::BuildRequest request(
project,
toolchain,
options
);The request does not build anything by itself. It only describes what the engine should prepare.
BuildPlan is produced by the planner.
It contains:
- the build graph
- selected target names
- the build directory
The plan does not execute commands and does not access the cache. It is a prepared build description.
Planner converts a BuildRequest into a BuildPlan.
Current behavior:
- validates that the request has a project
- validates that the request has a toolchain
- validates build options
- creates an initial build plan
- forwards the selected target into the plan
Future behavior will generate compile, archive, and link tasks from the project model and toolchain.
BuildResult is the final result returned by the engine.
It records:
- build status
- task results
- diagnostics
- optional error
- total duration
Statuses:
NotStartedSucceededFailedCancelled
BuildEngine is the high-level orchestration object.
It can:
- plan a build
- execute a prepared plan
- plan and execute a request
Example:
cgride::engine::BuildEngine engine;
auto result = engine.build(request);
if (!result.success())
{
return 1;
}
return 0;The first version of the engine provides the build orchestration structure.
The planner currently creates an empty graph after validating the request. Because of that, a full build may fail cleanly when the executor rejects the empty graph. This is expected for the first engine foundation.
The next step is to expand the planner so it creates real graph tasks from project targets and toolchain commands.
#include <cgride/engine/build_engine.hpp>
int main()
{
cgride::project::Project project;
cgride::toolchains::Toolchain toolchain;
cgride::engine::BuildOptions options;
options
.build_directory("build")
.target("app")
.mode(cgride::engine::BuildMode::Debug)
.jobs(4);
cgride::engine::BuildRequest request(
project,
toolchain,
options
);
cgride::engine::BuildEngine engine;
auto result = engine.build(request);
if (!result.success())
{
return 1;
}
return 0;
}From the module directory, use the Vix workflow:
vix buildFor a release build:
vix build --preset releasevix check --testsOr run the test command directly:
vix testsvix installThe install step exposes the cgride::engine integration target, public headers, and package metadata.