diff options
-rwxr-xr-x | lint/run_clang_tidy.py | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/lint/run_clang_tidy.py b/lint/run_clang_tidy.py index 3fb8a595..7f48e007 100755 --- a/lint/run_clang_tidy.py +++ b/lint/run_clang_tidy.py @@ -19,6 +19,7 @@ import shutil import subprocess import sys +CXX_LIB_VERSION = "13.3.0" def dump_meta(src, cmd): OUT = os.environ.get("OUT") @@ -31,7 +32,24 @@ def run_lint(src, cmd): dump_meta(src, cmd) config = os.environ.get("CONFIG") shutil.copyfile(os.path.join(config, ".clang-tidy"), ".clang-tidy") - extra = ["-Wno-unused-command-line-argument"] + extra = [ "-Wno-unused-command-line-argument"] + + # add include paths from the bundled toolchain + baseincludepath = os.path.join( + config, "toolchain", "include", "c++", CXX_LIB_VERSION + ) + # We're using the native toolchain, so arch-specific headers are + # only available for one arch. Hence we can try all supported candidates + # and add the ones found + for arch in ["x86_64", "arm"]: + idir = os.path.join(baseincludepath, + "%s-pc-linux-gnu" % (arch,)) + if os.path.exists(idir): + extra += ["-isystem", idir] + extra += [ + "-isystem", baseincludepath, + ] + if src.endswith(".tpp"): extra += ["-x", "c++"] db = [{ |