Skip to content

Commit

Permalink
Add external includes to clang-tidy invocation
Browse files Browse the repository at this point in the history
 - Current workaround is to manually add paths, e.g. `build:clang-tidy --copt=-isystem./external/mylibrary/include`
 - This uses bazel's [`external_includes`](https://bazel.build/rules/lib/builtins/CompilationContext#external_includes) to fix this
  • Loading branch information
michael-ahn authored and erenon committed Oct 3, 2024
1 parent e853110 commit cd2c6ef
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions clang_tidy/clang_tidy.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ def _run_tidy(

args.add_all(compilation_context.system_includes.to_list(), before_each = "-isystem")

args.add_all(compilation_context.external_includes.to_list(), before_each = "-isystem")

ctx.actions.run(
inputs = inputs,
outputs = [outfile],
Expand Down

0 comments on commit cd2c6ef

Please sign in to comment.