Skip to content

Repository files navigation

object-deps-report

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.

maintained license ruff pypeline

Installation

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")

Usage

Build the project first (so the executable and all objects exist), then build the report target:

cmake --build build/<variant>/<build_kit> --target objects-deps

The report is written to build/<variant>/<build_kit>/reports/object_dependencies.html.

How it works

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_command that runs clanguru 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 sets CMAKE_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 link target exists only for the prod build kit (test kits build per-component GTest executables), so run objects-deps in a prod build.

Start developing

The project is managed with uv and orchestrated by pypeline. Bootstrap the environment and run the full pipeline (venv, pre-commit, tests) with:

pypeline run

Committing changes

This repository uses commitlint for checking if the commit message meets the conventional commit format. Commit messages drive the automated release.

Continuous integration & 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.

Credits

Copier

This package was created with Copier and the browniebroke/pypackage-template project template.

About

An spl-core build extension that generates the object-file dependency graph report using clanguru

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages