I am using clangd extension on VSCodium for embedded development(STM32). The workflow involves GNU Make and arm-none-eabi-gcc as compiler.
I use compiledb to generate compile_commands.json file. While it works fine for libraries included in the project folder, system libraries are not properly recognised. For example I can’t include stdio.h. Headers like stdint and tgmath.h point to default clang directory instead of the one in arm-none-eabi directory (basically doesn’t point to right header files).
While it compiles just fine using make, I am not getting auto completions and suggestions for functions like printf, sprintf etc and, even including stdio.h displays ‘file not found’ errors in editor.
How exactly do you configure clangd? I have previously used ms-cpp-tools extension on VSCode (this extension does not work on VSCodium due to microsoft license restrictions), and on there you just add a c_cpp_configuration.json file and specify things like “intellisense-mode”(eg, linux-gcc, arm-gcc etc), “compiler-path”, " c-standard" etc. It then properly finds the header files for specified compiler.
Is there a similar configuration possible for clangd?