-
Notifications
You must be signed in to change notification settings - Fork 48
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
How to ensure that VSCode gets the correct compile_commands.json
for each subproject of the superbuild?
#1596
Comments
I saw that in https://cmake.org/cmake/help/v3.27/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html that:
Can't we just tell people to set |
A second point is how to ensure that the multiple |
compile_commands.json
for each subproject of the superbuild?
I renamed the issue to track the actual problem we want to face. |
Other related issues in cmake tools for vs:
The last issue refer to Zephyr, that indeed uses west ( https://docs.zephyrproject.org/latest/develop/west/index.html ), that indeed is something similar to cmake-based superbuild/colcon/catkin. |
This does not seem to work for me: this is how i tested (vscode).
|
I am not sure, but I guess the environment variable is ready only once when the project is configuring for the first time. Indeed, by checking the CMake's source code this is the case: https://github.com/Kitware/CMake/blob/v3.28.3/Modules/CMakeGenericSystem.cmake#L74-L79 . Indeed this may be quite confusing, and explicitly passing the option may be more clear. |
Tested the patch and it works, all the Then adding the following to {
"C_Cpp.default.compileCommands": "${workspaceFolder}/build/merged_compile_commands.json",
"cmake.mergedCompileCommands": "${workspaceFolder}/build/merged_compile_commands.json"
}
allows for intellisense to work. |
Great, can we document this somewhere? @LoreMoretti do you have any suggestion on where to document this? |
What about here: ami-iit/ami-commons#4 |
Also in https://github.com/ami-iit/ami-commons/blob/master/doc/visual-studio-code.md maybe? Even though this is more specific to the superbuild |
I am a bit afraid that that issue is not in the path of things that new users will encounter when the join the AMI lab. Furthermore, this is a more robotology-superbuild problem, that is related also to users of other labs. My suggestions are:
|
How about shipping the settings.json file along with the superbuild repo, this would simplify the user operations needed. |
Sure. Do you think it could make sense to also enable the |
At this point I would say yes, so the user has to to no action to enable this features in vscode. |
For using clangd extension the I have opened an issue on But for now, to be compatible with both
|
Perhaps it could make sense that if
CMAKE_EXPORT_COMPILE_COMMANDS
is set toON
in the robotology-superbuild, we also set it to on in all the subprojects?@LoreMoretti
The text was updated successfully, but these errors were encountered: