How capibaraengineer/module-dependency-handler works
ModuleDependencyHandler is a CLI for discovering C++ module interface files, resolving module and partition imports, ordering modules by dependency level, and invoking Clang to precompile them. The primary workflow runs from CLI arguments through scanning, representation and dependency analysis, graph construction, and compilation. The graph also distinguishes parsing from representation building. The README describes configurable extensions, but the sampled runtime scans only .cppm; the -file-types argument is not implemented. Clang command construction is described as temporary in the source.
Main entry points: main.cpp Application flow · moduleRepresentation.cpp Module representations · cliArgHandler.cpp Argument handling · preCompile.cpp Clang precompile
Components 11
CLI and discovery
- Application flow
ModuleDependencyHandler/source/main.cpp - Argument handling
ModuleDependencyHandler/source/cliArgHandler.cpp - File discovery
ModuleDependencyHandler/source/main.cpp
Module analysis
- Module representations
ModuleDependencyHandler/source/moduleRepresentation.cpp - Import/export parsing
ModuleDependencyHandler/source/parsing.cpp
Dependency ordering
- Dependency levels
ModuleDependencyHandler/source/moduleDependencyGraph.cpp
Precompilation
- Clang precompile
ModuleDependencyHandler/source/preCompile.cpp
Other components
- CLI user
- Module source files
- Clang executable
- PCM output files
Connections 12
- CLI user → Application flow: runs
- Application flow → Argument handling: parses arguments
- Argument handling → Application flow: returns paths
- Application flow → File discovery: scans path
- File discovery → Module source files: finds `.cppm`
- Application flow → Module representations: builds representations
- Module representations → Import/export parsing: checks declarations and imports
- Module representations → Module source files: reads files
- Application flow → Dependency levels: builds dependency levels
- Application flow → Clang precompile: passes ordered modules
- Clang precompile → Clang executable: executes command
- Clang executable → PCM output files: writes PCM files