-
Notifications
You must be signed in to change notification settings - Fork 15.3k
Description
when using clangd for cross-compilation projects, the option --query-driver allows clangd to find the standard headers used by the cross-compilation compiler.
For example, in our project we have in our vscode settings: "--query-driver=/opt/homebrew/bin/arm-none-eabi*"
1ca174b adds this feature to clangd.
We are also using clang-tidy to modernize our project. When using clang-tidy through clangd, everything works fine thanks to the aforementioned --query-driver.
But when running clang-tidy or run-clang-tidy.py from CLI, we hit stupid errors such as:
Error while processing /Users/ladislas/dev/leka/LekaOS/libs/LogKit/include/LogKit.h.
/Users/blablabla/LekaOS/drivers/CoreLED/include/RGB.h:8:10: error: 'cstdint' file not found [clang-diagnostic-error]
#include <cstdint>
^~~~~~~~~
/Users/blablabla/LekaOS/include/interface/drivers/LED.h:8:10: error: 'cstdint' file not found [clang-diagnostic-error]
#include <cstdint>
^~~~~~~~~
/Users/blablabla/LekaOS/libs/LogKit/include/LogKit.h:8:10: error: 'array' file not found [clang-diagnostic-error]
#include <array>
^~~~~~~
make: *** [clang_tidy_diff] Error 123
We've tried to fix this through CMake and the compilation database but with no success...
It would be amazing to also have clang-tidy accept the --query-driver option and generate the compiler standard include path to fix the kind of issue we are facing.