![]() |
Ansel 0.0
A darktable fork - bloat + design vision
|
Functions | |
| flags_from_database (build_dir) | |
| main () | |
Variables | |
| tuple | X_MACRO_HEADERS |
| ANSI = re.compile(r"\x1b\[[0-9;]*[A-Za-z]") | |
| tuple | SKIP_DIR_PARTS |
Check that every header compiles on its own.
A header should compile standalone. One that does not is relying on whoever includes
it having pulled something in first, which is the same defect as an unnecessary
include seen from the other side: the dependency is real, and written nowhere. It
breaks the day someone tidies an include in a file that never mentioned this header.
Each header is compiled as a translation unit containing nothing but an include of
itself, reusing the flags a real translation unit is built with, taken from
compile_commands.json. Only the syntax pass runs (-fsyntax-only), so no object code
is produced and the whole sweep is fast.
Headers that are NOT expected to stand alone are skipped, and the reason is recorded
rather than hidden:
- X-macro headers, re-included several times in one translation unit with different
macros defined, and expanded inside struct bodies. Compiling one alone is
meaningless: it has no guard, by design.
- Headers under a vendored or generated directory, which are not this project's to
fix.
Usage:
python3 tools/check_header_selfcontained.py -p build -o selfcontained.json [--jobs N]
| check_header_selfcontained.flags_from_database | ( | build_dir | ) |
Take the compile flags of a representative C translation unit.
Definition at line 55 of file check_header_selfcontained.py.
Referenced by main().
| check_header_selfcontained.main | ( | void | ) |
Definition at line 102 of file check_header_selfcontained.py.
References flags_from_database(), main(), and max.
Referenced by main().
| check_header_selfcontained.ANSI = re.compile(r"\x1b\[[0-9;]*[A-Za-z]") |
Definition at line 49 of file check_header_selfcontained.py.
| tuple check_header_selfcontained.SKIP_DIR_PARTS |
Definition at line 51 of file check_header_selfcontained.py.
| tuple check_header_selfcontained.X_MACRO_HEADERS |
Definition at line 40 of file check_header_selfcontained.py.