-
Notifications
You must be signed in to change notification settings - Fork 63
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
Clangd always chooses debug config compile commands with Ninja Multi-Config #2026
Comments
To clarify, you have a single |
Correct, an entry for each config. |
Clangs does not currently have any way to control which of multiple entries for a given file in There was one suggestion made in #1288; please feel free to share other ideas there. My understanding is that users currently handle situations like this by (1) arranging for there to be a The ways to achieve (1) can range from the build system having a way to directly generate the intended For (2), it can be done manually, though I have also come across tools that automate this such as: |
@HighCommander4 Thanks for the references! Post-processing seems like an ok compromise to manage the state yourself. A more automated solution I suppose would be to extend |
Just to add to this, clangd is not the only tool that consumes So an extension to the |
When building the project with cmake generator
Ninja Multi-Config
compile_commands are emitted with commands for all configs for each file (in my case Debug, Release, RelWithDebInfo in that order). Looking at clangd logs it is apparent that clangd always chooses commands for debug config (probably because it is the first one encountered). This leads to various problems, such as loss of includes (qt generatedui_<widget>.h
files are not found in the debug autogen folder, as they are in release folder) and might lead to other problems if configs differ significantly.Can this somehow be solved on the side of clang to determine the correct config to search for?
System information
Output of
clangd --version
:Editor/LSP plugin:
Operating system: Windows 11
The text was updated successfully, but these errors were encountered: