| 1 |
# This file is licensed under the Apache License v2.0 with LLVM Exceptions. |
| 2 |
# See https://llvm.org/LICENSE.txt for license information. |
| 3 |
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 4 |
|
| 5 |
load("@bazel_skylib//lib:paths.bzl", "paths") |
| 6 |
load("@rules_cc//cc:defs.bzl", "cc_library") |
| 7 |
|
| 8 |
_common_library_deps = [ |
| 9 |
"//clang:ast", |
| 10 |
"//clang:ast_matchers", |
| 11 |
"//clang:basic", |
| 12 |
"//clang:lex", |
| 13 |
"//clang:frontend", |
| 14 |
"//llvm:FrontendOpenMP", |
| 15 |
"//llvm:Support", |
| 16 |
] |
| 17 |
|
| 18 |
def clang_tidy_library(name, **kwargs): |
| 19 |
kwargs["srcs"] = kwargs.get("srcs", native.glob([paths.join(name, "*.cpp")], allow_empty = True)) |
| 20 |
kwargs["hdrs"] = kwargs.get("hdrs", native.glob([paths.join(name, "*.h")], allow_empty = True)) |
| 21 |
kwargs["deps"] = kwargs.get("deps", []) + _common_library_deps |
| 22 |
cc_library( |
| 23 |
name = name, |
| 24 |
**kwargs |
| 25 |
) |