-
Notifications
You must be signed in to change notification settings - Fork 463
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compdb: mergedCompileCommands for CMake subprojects #2029
Conversation
Signed-off-by: Felix Lelchuk <felix-el@users.noreply.github.com>
@Felix-El, can you describe how you can have more than one compile_commands.json in the same project? I am not familiar with this scenario and I need a repro to test your PR, before we accept it. |
Sure, this feature can help a lot if you are, like I am, working with CMake subprojects, i.e. using ExternalProject. Here is a multi-subproject test I've added with a new CMake featrue (scheduled for 3.22): https://gitlab.kitware.com/cmake/cmake/-/tree/master/Tests/InstallMode |
@Felix-El, we have a suggestion if you can update your PR. Let's have instead one path setting for the merged compile commands ("cmake.mergedCompileCommands") and no boolean because we can deduce everything based on the path being set or not. |
I assume that means the If that is correct I totally agree! |
Yes. We wanted to avoid requiring setting both the |
This replaces the collectCompileCommands addition, which altered the behavior of copyCompileCommands into a standalone mergeCompileCommands config option so both can co-exist without cross-interference.
Ok, please give it another look... |
…ands are set, notifying the developer that the copy setting is ignored.
This changes visible behavior
The following changes are proposed:
Add an option to collect all
compile_commands.json
from the build directory and merge them into one for consumption byvscode-cpptools
.The purpose of this change
The option "Merged Compile Commands" will merge all
compile_commands.json
from the build directory into a new JSON file. This functionality is an enabler for IntelliSense in ExternalProject based "superbuilds".Other Notes/Information
In order to get IntelliSense support with superbuilds, few settings are required: