An spl-core build extension that generates the object-file dependency graph report for a variant using clanguru.
The extension wires a CMake custom target objects-deps into the variant build.
Because the report is built from the object files listed in
compile_commands.json, the target depends on the linked executable (so every
object is guaranteed to exist) and on compile_commands.json. Running the target
invokes clanguru analyze to produce an interactive HTML dependency graph.
Install this via pip (or your favorite package manager):
pip install object_deps_report
Then, in the consuming spl-core project's CMakeLists.txt, after spl.cmake and
the variant parts are included:
include(".venv/Lib/site-packages/object_deps_report/index.cmake")Build the project first (so the executable and all objects exist), then build the report target:
cmake --build build/<variant>/<build_kit> --target objects-depsThe report is written to
build/<variant>/<build_kit>/reports/object_dependencies.html.
The extension needs no configuration file and reads no KConfig/autoconf state.
Its index.cmake (included from your CMakeLists.txt) defers a hook to the end of
CMake configure that runs object_deps_report generate ...; that writes
object_deps_report.cmake into the build directory and include()s it. The
generated file contains:
- an
add_custom_commandthat runsclanguru analyze --compilation-database ${CMAKE_BINARY_DIR}/compile_commands.json --output-file <report>; DEPENDS $<TARGET_FILE:${LINK_TARGET_NAME}> ${CMAKE_BINARY_DIR}/compile_commands.json— spl-core's linked executable target (so every object is built first, and the report regenerates when the binary changes) plus the compilation database (spl-core setsCMAKE_EXPORT_COMPILE_COMMANDS ON, so it always exists);add_custom_target(objects-deps DEPENDS <report>)— not part of the default (ALL) build, so the report is produced on demand.
The
linktarget exists only for theprodbuild kit (test kits build per-component GTest executables), so runobjects-depsin a prod build.
The project is managed with uv and orchestrated by pypeline. Bootstrap the environment and run the full pipeline (venv, pre-commit, tests) with:
pypeline runThis repository uses commitlint for checking if the commit message meets the conventional commit format. Commit messages drive the automated release.
CI runs on GitHub Actions (.github/workflows/ci.yml): lint (pre-commit),
commitlint, a test matrix (Python 3.10/3.13 × Ubuntu/Windows), and a release job.
Releases are automated with python-semantic-release:
merging to main bumps the version from the conventional-commit history and
publishes to PyPI (trusted publishing) and GitHub Releases.
This package was created with Copier and the browniebroke/pypackage-template project template.