Build Invariants
Dependencies are private
A program or plugin that links mrdocs::mrdocs-core or mrdocs::plugin-api gets the Mr.Docs API and nothing else. Our dependencies (LLVM, Clang, Lua, JerryScript, dom and handlebars) reach neither the link line of a consumer nor the export table.
A tool that exports a symbol of LLVM, for example after a dependency lost its hidden visibility, fails the export check:
CMake Error at tests/integration/plugin-api/exports/CheckExports.cmake:212 (message):
/path/to/build/bin/mrdocs exports 1 symbols that are not in the mrdocs namespace, for
example:
llvm::StringRef::compare(llvm::StringRef) const
The fix is to link the dependency privately and keep its symbols hidden, so only the mrdocs namespace is exported.
|
Guard
The export check runs on Linux and macOS, not in sanitized builds. |
Only marked declarations are exported
A declaration enters the export table only when it carries MRDOCS_DECL (or the macro of its library).
When the markers stop exporting the API, the table falls under five hundred symbols and the check says so:
CMake Error at tests/integration/plugin-api/exports/CheckExports.cmake:199 (message):
/path/to/build/bin/mrdocs exports 41 symbols in the mrdocs namespace, fewer than 500: the
MRDOCS_DECL markers are not exporting the API
The fix is to put the marker back on the declaration:
class MRDOCS_DECL Exception
|
Guard
Three tests guard the table:
The markers are in |
Shared and static builds have the same plugin workflow
You write and build a plugin the same way whether you build Mr.Docs static or with MRDOCS_BUILD_SHARED.
|
Guard
The project in Those rows use GCC and Clang on Linux, MSVC on Windows and Apple Clang on macOS, so the tests do not cover another toolchain. |