MaskRay / ccls

C/C++/ObjC language server supporting cross references, hierarchies, completion and semantic highlighting
Apache License 2.0
3.72k stars 254 forks source link

alternate among multiple compile_command.json files #966

Open windrg opened 2 months ago

windrg commented 2 months ago

Observed behavior

Hi, I really appreciate your this great work first of all, especially it’s very helpful for me to understand the context in reading codes through using “Call Hierachy”. By the way, now I’m about to ask one thing rather than reporting a bug or complainning. My problem is, My project is set to compile a source code twice(or more times) for its certain purpose switching its preprocessor. In other words, it can have multiple compile_command.json files - for example, one has a compilation switch “SWITCH_A” and the other one has “SWITCH_B” instead of “SWITCH_A”. For your understanding,

ifdef SWITCH_A

define APPLE (3)

elif defined SWITCH_B

define APPLE (10)

804

so I can tell this project can have 2 compile_commands.json. I can generate those 2 but I could not figure out so far how to switch from one to the other, instead of renaming one of those 2 to “compile_commands.json”.

Expected behavior

I need your advice to switch among those multiple commands, in more elegant way.

Steps to reproduce

### System information