src/
src/ holds the private implementation of the MrDocs library, in src/mrdocs/.
The tree mirrors the public module layout: a public include/mrdocs/X/Foo.hpp pairs with src/mrdocs/X/Foo.cpp, and private headers live beside their sources.
Include rules
These rules decide how a #include names a header:
-
A public header is
<mrdocs/…>. -
A private header is a quoted, relative path, for example
"Foo.hpp"or"../Support/Filesystem/Temp.hpp". -
The private companion of a public header
X.hppisXImpl.hpp(src/mrdocs/Support/ReporterImpl.hppis one). -
To use another module, call its public API and never include its private headers.
The core target has src/ on its private include path, and the unit and golden test targets add it too, so tests reach internals as <mrdocs/…>.
The angle form therefore also resolves for private headers, and some library sources use it today.
New library code uses the quoted form, and a reviewer has to catch the angle form, because the compiler accepts both.
Content that belongs elsewhere
| Content | Where it goes |
|---|---|
Public headers |
|
Programs with a |
|
Components that never depend on the core |
|
Tests |
|
Contents by subdirectory
| Directory | Purpose |
|---|---|
|
Clang AST traversal and symbol extraction. |
|
Builds and finalizes the extracted-symbol model. |
|
The output generators, one subdirectory per format ( |
|
The scripting and templating engine implementations. |
|
The extension mechanism, the bindings and the discovery of addons. |
|
The implementation of the configuration types. |
|
Private utility implementations, mirroring the public |
|
The implementation of |
Two files sit at the top of src/.
One is CMakeLists.txt, and the other is setup-llvm.cmake, which finds LLVM and defines the mrdocs-llvm target.
The file src/mrdocs/ConfigOptions.json is the schema of the configuration options, and the generators in utils/codegen/ read it.
Build integration
The root build adds src/ unconditionally.
src/CMakeLists.txt collects every .cpp, .hpp, .ipp and .natvis file under src/mrdocs/ with GLOB_RECURSE CONFIGURE_DEPENDS.
A new file needs no edit to the list.
src/CMakeLists.txt defines these targets:
| Target | What it is |
|---|---|
|
The installed library: static, or shared when |
|
An object library: it compiles the core’s sources to object files ( |
|
The interface target described on include/. |
|
An interface target made by |
With MRDOCS_INSTALL on, mrdocs-core installs its runtime file into CMAKE_INSTALL_BINDIR and its library and archive files into CMAKE_INSTALL_LIBDIR.
The same file installs the bundled libc++ and Clang resource headers into share/mrdocs/headers/.