You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there! I'm trying to build a static index for a codebase that I'm cross-compiling.
I believe that in order to use clangd in this situation, you need to provide a path to the compiler with the --query-driver flag so that clangd can find the appropriate headers. However, there's no such flag for clangd-indexer. So when I try to build the index, I'm seeing a lot of include errors as it's not finding the correct headers.
Is there a way to get this to work that I've missed? And if not, would you accept a patch to add a flag like this to clangd-indexer?
The text was updated successfully, but these errors were encountered:
Is there a way to get this to work that I've missed?
The alternative to --query-driver is to specify your cross-compiler's system include paths manually.
You can run <cross-compiler> -E -v -xc++ - (this is what clangd does when --query-driver is specified; replace -xc++ with -xc if working on C code), look at the list of system include paths printed after #include <...> search starts here, and add a corresponding -isystem <path> to your source files' compile commands for each one.
Unfortunately, the simplest way to add those -isystem <path> flags would be using a clangd config file, but that's not hooked up for clangd-indexer either...
So that leaves you with arranging for your compile_commands.json to contain those -isystem flags, which may or may not be straightforward depending on how you're generating your compile_commands.json.
And if not, would you accept a patch to add a flag like this to clangd-indexer?
I don't call the shots so I can't guarantee that a patch would be accepted, but I think that would be a nice addition and fill a logical gap. I'm happy to provide guidance if you'd like to write a patch.
Hi there! I'm trying to build a static index for a codebase that I'm cross-compiling.
I believe that in order to use
clangd
in this situation, you need to provide a path to the compiler with the--query-driver
flag so thatclangd
can find the appropriate headers. However, there's no such flag forclangd-indexer
. So when I try to build the index, I'm seeing a lot of include errors as it's not finding the correct headers.Is there a way to get this to work that I've missed? And if not, would you accept a patch to add a flag like this to
clangd-indexer
?The text was updated successfully, but these errors were encountered: