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 do I use compile_commands.json #6592
Comments
|
For the C++ Extension to use the compile_commands.json file, place its full file path into the c_cpp_properties.json file. This file is used to configure the C++ Extension IntelliSense. You can edit the file by running one of the two commands: |
|
I know that but what do I actually put in the |
The compile_commands.json file is generated by CMake and it is not usually modified for the C++ Extension to use, unless there is some special case or workaround that needs to be done. https://cmake.org/cmake/help/latest/variable/CMAKE_EXPORT_COMPILE_COMMANDS.html |
|
@AverageComet250 The format specifications for It would be possible to manually compose |
|
If you are using CMake, then we recommend you install the CMake Tools extension. If you let that extension configure your project, you will not need compile_commands.json. If you have any trouble configuring it, open an issue here and we can help you out. |
|
I want to make it so that the build option runs Instead of
Also I am using the cmake tools extension and my objective is to change what the build button on the bar at the bottom does |
|
Hi @AverageComet250 . With CMake Tools installed, you should see a text button at the bottom of the window that allows selection of build configuration type (Release, Debug, RelWithDebInfo, MinSizeRel), . Alternatively, you can use It sounds like you want to leverage a multi-config build, based on the command line you specified above (which passes in the variant at build time). Depending on the kit you've selected, CMake may or may not generate a 'multi-config' build. I don't believe CMake Tools exposes this (as some generators do not support multi-config). However, you can use
|
|
I think my variant is Release and I'm using the x86_64 visual studio 2019 kit. I will test the cmake configure command and come back on whether that works. Thanks |
|
@AverageComet250 . Did my last response help you get this working? Or, if not, was there some part that did not work as described? |
|
Sorry I'm still yet to do a proper test, though I can confirm that my variant is Debug and my kit is as specified in earlier post. I'll come back after a proper test. I closed it by accident by the way which is why I reopened it |
|
Hey @Colengms, this issue might need further attention. @AverageComet250, you can help us out by closing this issue if the problem no longer exists, or adding more information. |
|
I'm gonna close this as I haven't actually tested it yet and I don't think I'm ever gonna need this. If someone could tell me how to modify what the build button does though, I'd really appreciate it |
|
@AverageComet250 What build button? |
|
The one on the bar at the bottom, the one where you can select things like the python interpreter and other things |
|
Our extension doesn't provide that button so you'll need to ask the team (extension provider) that does. If you're referring to the CMake Tools build button you can use the "CMake: Set Build Target" command; otherwise, maybe there's another similar command you could look for. |
So I've been looking into ultralight and uses the below to build a project
I'm not fully sure what vscode does to build projects (and whether its this plugin or the cmake one that I need to change the settings for), but I know it isn't this. It seems I need a
compile_commands.jsonfile that I tell this plugin to use at the project level but I cant find documentation on this or anything showing the file format. I would appreciate it if someone could tell me how to use this file.The text was updated successfully, but these errors were encountered: