I am trying to get clangd to work for a project that is cross compield to various targets. Using GCC and regular Makefiles.
First I tried to generate compile_commands.json with “compiledb” project from github.
It generates the filesok, but clangd gets into trouble mixing up stdlib from clang and gcc it seems.
Then I tried with a compile_flags.txt instead and get it to work decently if omitting all references to the sysroot to the cross compile target.
But then it seems the clangd indexer requires compile_commands.json, right?
So is there any recommended way to handle cross_compiled gcc make projects?
I have tried various combinations of these flags:
But there is always some problems like std lib headers not found or c++17 features not recognized or differences in stdlib messing it up.
So should it be possible to make a cross compile SDK (gcc) work with clangd?
Perhaps an option for me is to generate compile_commands.json and the filter out all references to the SDK?