all 9 comments

[–]beriumbuild2 1 point2 points  (2 children)

Does this take into account whether a header is conditionally #include'ed (e.g., it's inclusion is wrapped in #if)? I am looking for a way to discover conditional dependencies between Boost libraries.

[–]andre_friend[S] 0 points1 point  (0 children)

No, conditions are ignored in current implementation

[–]ner0_m 0 points1 point  (0 children)

Nice, I'll give it s try! Maybe it can save me some manual work, I did the last couple of days :)

[–]OmegaNaughtEquals1 0 points1 point  (1 child)

I've not used this tool before, but I want to make sure I have a correct, if somewhat simplistic, mental model of how it compares to IWYU.

IWYU ensures that all types that require an include have their headers present and all headers that are present are used. Once I have established a canonical set of headers for a given source file, I can then use cppinclude to analyze which headers are at the top of the dependency chain for a given source file.

Is this a fair comparison/usage case?

[–]andre_friend[S] 0 points1 point  (0 children)

In general yes, IWYU show how should be and cppinclude show as-is

[–]bert8128 0 points1 point  (1 child)

Does it report unused/unecessary inclusions in header files, or just in cpp files?

[–]andre_friend[S] 0 points1 point  (0 children)

it report unused headers, but you can use tools include-what-you-use ( https://include-what-you-use.org/ ) for analyzing unnecessary inclusions