Skip to content

Commit d490880

Browse files
committed
refactor(metadata): integrate Boost.Describe to remove manual mapping boilerplate
This introduces Boost.Describe and Boost.Mp11 and applies them across metadata types (symbols, enums, inline elements) to replace hand-written io.map() calls with reflection-based code. This improves maintainability without altering the public API or user-facing features. Boost.Describe and Boost.Mp11 are *private* dependencies, i.e. they are not used in any public Mr. Docs include.
1 parent 6cee4af commit d490880

63 files changed

Lines changed: 1645 additions & 554 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -433,6 +433,44 @@ jobs:
433433
run: |
434434
rm -r ../third-party/llvm-project
435435
436+
- name: Install Boost.Mp11
437+
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.12
438+
with:
439+
source-dir: ../third-party/boost_mp11
440+
git-repository: https://github.com/boostorg/mp11
441+
git-tag: boost-1.90.0
442+
patches: |
443+
./third-party/patches/boost_mp11/CMakeLists.txt
444+
./third-party/patches/boost_mp11/boost_mp11-config.cmake.in
445+
build-dir: ${sourceDir}/build
446+
cc: ${{ steps.setup-cpp.outputs.cc }}
447+
cxx: ${{ steps.setup-cpp.outputs.cxx }}
448+
build-type: Release
449+
shared: false
450+
install: true
451+
install-prefix: ${sourceDir}/install
452+
run-tests: false
453+
trace-commands: true
454+
455+
- name: Install Boost.Describe
456+
uses: alandefreitas/cpp-actions/cmake-workflow@v1.8.12
457+
with:
458+
source-dir: ../third-party/boost_describe
459+
git-repository: https://github.com/boostorg/describe
460+
git-tag: boost-1.90.0
461+
patches: |
462+
./third-party/patches/boost_describe/CMakeLists.txt
463+
./third-party/patches/boost_describe/boost_describe-config.cmake.in
464+
build-dir: ${sourceDir}/build
465+
cc: ${{ steps.setup-cpp.outputs.cc }}
466+
cxx: ${{ steps.setup-cpp.outputs.cxx }}
467+
build-type: Release
468+
shared: false
469+
install: true
470+
install-prefix: ${sourceDir}/install
471+
run-tests: false
472+
trace-commands: true
473+
436474
- name: Install JerryScript
437475
uses: alandefreitas/cpp-actions/cmake-workflow@v1.9.2
438476
with:
@@ -567,6 +605,8 @@ jobs:
567605
-D LUA_ROOT="${{ steps.rmatrix.outputs.third-party-dir }}/lua/install"
568606
-D Lua_ROOT="${{ steps.rmatrix.outputs.third-party-dir }}/lua/install"
569607
-D lua_ROOT="${{ steps.rmatrix.outputs.third-party-dir }}/lua/install"
608+
-D boost_mp11_ROOT="${{ steps.rmatrix.outputs.third-party-dir }}/boost_mp11/install"
609+
-D boost_describe_ROOT="${{ steps.rmatrix.outputs.third-party-dir }}/boost_describe/install"
570610
${{ runner.os == 'Windows' && '-D LibXml2_ROOT=../third-party/libxml2/install' || '' }}
571611
export-compile-commands: true
572612
run-tests: true

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,10 @@ endif()
223223

224224
set(CMAKE_FOLDER Dependencies)
225225

226+
# Boost.Describe + Boost.Mp11 (header-only, fetched via bootstrap.py recipes)
227+
find_package(boost_mp11 REQUIRED)
228+
find_package(boost_describe REQUIRED)
229+
226230
# LLVM + Clang
227231
if (LLVM_ROOT)
228232
# LLVM_ROOT is absolute
@@ -320,6 +324,7 @@ target_compile_definitions(
320324
PRIVATE
321325
-DMRDOCS_TOOL
322326
)
327+
target_link_libraries(mrdocs-core PRIVATE Boost::describe Boost::mp11)
323328

324329
# Dependencies
325330
target_include_directories(mrdocs-core

docs/mrdocs.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,14 @@ implementation-defined:
1313
- 'mrdocs::detail'
1414
- 'mrdocs::report::detail'
1515
- 'mrdocs::dom::detail'
16+
exclude-symbols:
17+
# Symbols defined when using the Boost.Describe macros.
18+
- 'mrdocs::**::boost_base_descriptor_fn'
19+
- 'mrdocs::**::boost_public_member_descriptor_fn'
20+
- 'mrdocs::**::boost_protected_member_descriptor_fn'
21+
- 'mrdocs::**::boost_private_member_descriptor_fn'
22+
- 'mrdocs::**::boost_enum_descriptor_fn'
23+
- 'mrdocs::**::should_use_BOOST_DESCRIBE_NESTED_ENUM'
1624
multipage: true
1725
generator: adoc
1826
cmake: '-D MRDOCS_DOCUMENTATION_BUILD=ON'

0 commit comments

Comments
 (0)