erenon / bazel_clang_tidy

Run clang-tidy on Bazel C++ targets directly, efficiently, with caching enabled
MIT License
109 stars 58 forks source link

Pass through `--sysroot` #51

Closed lalten closed 1 year ago

lalten commented 1 year ago

clang-tidy supports --sysroot and in fact needs it to find header files in some cases. For example if building with a hermetic compiler and libc++/libstdc++.

The flag was first ignored in https://github.com/erenon/bazel_clang_tidy/commit/c0d0793ccf65ff80920b31f3b60a04eb5fd43372 but I couldn't find a reason as to why the removal was necessary.

erenon commented 1 year ago

Thanks! The reason it was ignored to be able to run clang tidy, with only gcc setup with sysroot. If you pass a gcc sysroot to clang, bad things happen (the commit message could have been better...). Let's try this change and see if ppl complain.