GitXplorerGitXplorer
K

header_walker

public
1 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
0cb6d4a7d62dbf4b4f079fe32a9dc11df093cb28

Change API such that projects with a config file can regenerate compile_commands automatically as well

KKimundi committed 6 years ago
Unverified
aa5653d7a735a8e283b313b371f052aeba150951

Add ability to automatically configure the cmake build directory

KKimundi committed 6 years ago
Unverified
cbd0ca275320c2eda48e89ae45f24530a722617d

Add missing default mapping file

KKimundi committed 6 years ago
Unverified
906b492dc86c81110ffde805c126f03ff7eb4582

Add better error handling

KKimundi committed 6 years ago
Unverified
57c2b2b822e308314886022cf32765d44e958511

Add cli flags and disable all outputs per default

KKimundi committed 6 years ago
Unverified
a32d36201bc0e1db7530433ebed075e2cd5b4525

iwyu options

KKimundi committed 6 years ago

README

The README file for this repository.

header_walker

A C++ utility for walking the include trees of a list of source files.

It assumes gcc as a C++ compiler, and that it is used with C++, not C code.

Usage

Inferring from a cmake project layout:

  1. Ensure you have a cmake project at location <project_root>, with its build directory in <project_root>/build
  2. Generate a <project_root>/build/compile_commands.json file for the project by setting the CMAKE_EXPORT_COMPILE_COMMANDS cmake flag. Might require reconfiguration or rebuilding the project.
  3. Invoke header_walker.py --from_cmake_build_dir <project_root>/build

Using a config file:

All settings of the tool can be controlled with a json config file. Example:

{
    "db_file"   : "<project_root>/build/compile_commands.json",
    "project_root": "<project_root>",
    "filter_out_system_search_paths": true,
    "filter_out_paths_outside_project_root": true,
    "print_all_unique_header": true,
    "print_header_dependencies": true,
    "excluded_directories": [
        "<project_root>/external",
        "<project_root>/build",
        "<project_root>/test",
    ]
}

Both the filter_* and excludeed_directories options can be used to filter out files. Typically you would use them to hide system header, external libraries or generated source code.

Usage:

  1. Invoke header_walker.py --config config.json

Combinations

You can use a config file for the basic settings, and override and extend its values with commandline parameters.