libgit2 / docurium

Doxygen replacement for the libgit2 project
http://libgit2.github.com/libgit2
MIT License
158 stars 25 forks source link

Use clang's include paths when parsing the translation units #45

Closed carlosmn closed 5 years ago

carlosmn commented 5 years ago

For quite a while we've had the issue that some type definitions were missing, most notably size_t when generating documentation for libgit2. We "solved" that by defining it ourselves when DOCURIUM is defined. This is clearly a terrible hack but we did not know what was happening.

Then in #39 we got errors about not finding stddef.h. Further investigation revealed that this was because that PR included a change to ask the library to print out errors.

It turns out that by default we do not include the directory in which clang stores its headers, which means we've been missing some necessary ones for quite some time now.

This PR queries clang for its include file by parsing its verbose output (inspiration from drothlis/clang-ctags#7) and passing it as an include path. We also remove -DDOCURIUM=1 as it should no longer be necessary.