Sarcasm / irony-mode

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

Errors in single entry project #545

Closed mattt-b closed 4 years ago

mattt-b commented 4 years ago

I've used irony-mode many times in projects where each file can be compiled individually with no issues. Now I am trying to use it in a project that can only be compiled from one file. There are multiple files in the projct, foo.c, bar.c, etc... and one main.c that #includes all of the other files and all dependencies (while none of the other files #include anything).

This works great when editing main.c but it fails when editing other files in the project because they don't understand that all the includes are in main.c.

I've tried editing the compile_commands.json to specifically compile main.c on each individual file, but it seems to drop that part of the command when I look at irony-cdb-menu.

Is there a way I can make this work correctly?

Sarcasm commented 4 years ago

Is there a way I can make this work correctly?

I don't think so.