I have an embedded C project, and want to read it in VSCode with clangd extension. I've built the project and generated compile_commands.json successfully with xmake/cmake. But clangd cannot find (cross compiler's) system headers using the generated compile_commands.json.
According to clangd documentation, I need to pass -isystem
flag to clangd in compile_commands.json. I don't know how. The flags in "arguments" in compile_commands.json are passed to the cross compiler rather than clangd. Run clangd -isystem <path>
results in "Unknown command line argument '-isystem'". Where should I add the -isystem
flag?