conjure::core is the foundation every other module links: the error model, logging and asserts, math,
containers, strings, memory, time, jobs, JSON, the virtual file system, OS services and reflection. This chapter
describes the shape of the module, the conventions every area shares, an index of the areas and how the module
is built and tested. The areas themselves (purpose, headers, algorithms, threading guarantees, extension points,
tests) are documented on two sub-pages:
Public headers live under engine/include/conjure/core/, sources under engine/src/core/<area>/, tests under
tests/core/<area>/; every area has a README at engine/src/core/<area>/README.md with the finer behavioural
notes.
See engine/src/core/README.md for additional implementation notes.
Umbrella header of the math area: glm aliases and formatters, scalar utilities, transform, aabb, plane, frustum, ray, rect and the projection helpers below.
Convenience include for the whole math area (conjure::math): glm aliases, transform, aabb, plane, frustum, ray, rect, scalar utilities and projection helpers.
Core is one module made of eleven independently buildable areas. engine/src/core/CMakeLists.txt creates
the umbrella conjure_core (an INTERFACE target, alias conjure::core) that adds engine/include and the
generated include directory, then adds each area directory; every area declares a static library
conjure_core_<area> (alias conjure::core_<area>) with conjure_add_core_area(<area> PUBLIC_HEADERS...
SOURCES... PUBLIC_DEPS...) from cmake/ConjureModule.cmake and a test executable conjure_core_<area>_tests.
Other modules link conjure::core; a core area links only the areas it needs:
Area
Library
Headers under conjure/core/
Public deps beyond foundation
foundation
conjure::core_foundation
flat
- (Threads::Threads)
math
conjure::core_math
math.h, math/
glm
containers
conjure::core_containers
containers/
-
strings
conjure::core_strings
flat
-
memory
conjure::core_memory
memory/
-
time
conjure::core_time
flat
-
jobs
conjure::core_jobs
jobs/
-
vfs
conjure::core_vfs
vfs/
-
json
conjure::core_json
json/
vfs (private), yyjson (private)
system
conjure::core_system
flat
jobs (private), stb (private)
reflect
conjure::core_reflect
reflect/
json, strings, math, containers, time
Each area library is registered with conjure_register_static_library(), so the whole of core is
whole-archived into the umbrella shared library conjure_shared by conjure_finalize_engine()
(Module system 2, Modules module 7).
Each area section on the sub-pages has the same subheadings: Headers (a table of every public header),
Algorithms, Threading, Extension points where the area has any, and Tests.
fallible calls return result<T> / status with a generic core::error_code; core declares no category of its own; programmer errors assert
Allocation
new/delete/malloc are confined to memory
Threads
std::thread / std::jthread are confined to jobs; every other thread is a jobs::dedicated_thread, the system::process pipe readers included (system links jobs for them)
Platform code
per-platform translation units (*_windows.cpp, *_posix.cpp) selected by CMake; only conjure/core/platform_detect.h reads compiler macros
Third-party headers
never in public headers; glm is the single exception, through conjure/core/math/glm_types.h
Determinism
everything is headless and deterministic given the same inputs
Two names need qualifying after a using namespace: write core::clock (ambiguous with the C library's
::clock()) and reflect::type_info (ambiguous with ::type_info from <typeinfo> on MSVC).
python tools/build.py --build-dir build/core --test -R core_ # every core area
python tools/build.py --build-dir build/core_jobs --target conjure_core_jobs_tests --test -R core_jobs
tests/core/<area>/test_<header>.cpp mirrors every public header (tools/check_style.py --tests-mirror-headers,
CTest entry style.check); conjure_core_<area>_tests is one CTest entry per TEST_CASE. Every public header
also compiles alone through conjure_header_check (part of the default build). Everything is headless and
deterministic: manual_clock, seeded random, 0-worker job systems, memory_file_system or a
conjure::testing::temp_directory. The exit gates are listed in.
Tip
Build and test one area at a time while working in it (--target conjure_core_<area>_tests --test -R
core_<area>); the whole module is only needed before the review checklist.