Andersbakken / rtags

A client/server indexer for c/c++/objc[++] with integration for Emacs based on clang.
http://www.rtags.net
GNU General Public License v3.0
1.83k stars 253 forks source link

Loading compilation database with duplicate files #764

Open Nephyrin opened 8 years ago

Nephyrin commented 8 years ago

In a project I'm working on, we have a large chunk of files that are built twice, once for a client library and once for a server library. This causes a few pain points with rtags:

Andersbakken commented 8 years ago

Yeah. We have a file or two like this in our codebase at work as well. Ideally RTags would compile the file twice and combine all the symbols into one set but it's a bit of a mess. Currently that's not really how it works but I suppose it could be made to do that.

It's a bit of work butI'll see what I can do.

Anders

On Tue, Aug 9, 2016 at 2:01 PM, John Schoenick notifications@github.com wrote:

In a project I'm working on, we have a large chunk of files that are built twice, once for a client library and once for a server library. This causes a few pain points with rtags:

-

Only the commandline that appears second is used. Ideally, rtags would note both configurations for the file, and let one be selected when invoking rc. This makes things tricky when working with code like:

ifdef CLIENT_LIBRARY

...

elif SERVER_LIBRARY

...

endif

... as only one of the two branches will be visible to rtags.

  • When re-loading the compilation database, even with no changes, these duplicates files are all invalidated due to being encountered multiple times.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/Andersbakken/rtags/issues/764, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEdSqLvtOm5ord4vifeHgL7Y39C9iMDks5qeOq5gaJpZM4JghFx .

Nephyrin commented 7 years ago

Is something like this closer to being possible with the multiple-build support? I can generate and load separate compile_commands.json files for the different configurations, but rtags appears to have selected one of the configurations and used it for all diagnostic/completion purposes.

Even with probably-very-difficult merging semantics, it would be very useful to have a configuration-select command to switch between the versions of the file. Currently this requires switching compilation databases, and triggering much reprocessing.