Sarcasm / irony-mode

A C/C++ minor mode for Emacs powered by libclang
GNU General Public License v3.0
906 stars 99 forks source link

Include local project header in another header? #527

Closed jmichaelbarker closed 5 years ago

jmichaelbarker commented 5 years ago

My company's build environment currently has a few instances of including header files from elsewhere in the project in another header. For example, we have a/b/c.h that we would like to have included in e/f/g.h; however, e/f/g.h is never compiled directly (since it's just a header), and every file that includes e/f/g.h has a CMake target_include_directories(a/b) and is thus able to include e/f/g.h, and a/b/c.h "implicitly." Is there any way to make irony-mode work on e/f/g.h? At the moment, on the line include <g.h>, I receive the error "'g.h' not found". I would prefer to not have to change our CMake configuration, or our include structure. Note that in file i/j/k.c that includes <g.h>, all completions work as expected, including those associated with a/b/c.h.

jmichaelbarker commented 5 years ago

I realize now that this error was due to configuration problems in my environment - I had just upgraded from Ubuntu 16.04 to 18.04, and apparently something in CMake broke just enough to cause this problem. On the off chance anyone needs this, I reinstalled cmake and clang and the problem has resolved itself.