driver-mode passed in wrong place to clang-tidy and therefore ignored leading to errors in checks
Hello CMake team!
There is an outstanding PR for the clang-tidy to allow accepting of the driver-mode from the --extra-args-before, such as CMake is doing: https://github.com/llvm/llvm-project/pull/66553
Without this PR merged, the driver mode as passed by cmake is ignored by tidy which can lead to false-positive diagnostic errors. It's quite easy to reproduce - just include some compiler specific header, e.g. xmmintrin.h and the crash is guaranteed if the driver-mode is g++, as clang-tidy doesn't recognize the GCC-specific headers and builtins.
To make clang-tidy behave correctly, the driver mode has to be passed directly after the -- delimiter. At least until the mentioned PR is merged.
Is there anything that can be done in CMakeLists.txt to work around the above mentioned shortcommings? Or does this require code changes in cmake to properly pass the driver-mode to tidy?