-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathBUILD.bazel
44 lines (38 loc) · 1.13 KB
/
BUILD.bazel
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_proto_library")
proto_library(
name = "extra_actions_base_proto",
srcs = ["extra_actions_base.proto"],
)
cc_proto_library(
name = "extra_actions_base_cc_proto",
deps = [":extra_actions_base_proto"],
)
# Extracts a single compile command from an extra action.
cc_binary(
name = "extract_compile_command",
srcs = ["extract_compile_command.cc"],
deps = [
":extra_actions_base_cc_proto",
"@com_github_tencent_rapidjson//:rapidjson",
"@com_google_protobuf//:protobuf",
],
)
action_listener(
name = "extract_json",
extra_actions = [":extra_action"],
mnemonics = ["CppCompile"],
visibility = ["//visibility:public"],
)
extra_action(
name = "extra_action",
cmd = "$(location :extract_compile_command) \
$(EXTRA_ACTION_FILE) \
$(output $(ACTION_ID).compile_command.json)",
out_templates = ["$(ACTION_ID).compile_command.json"],
tools = [":extract_compile_command"],
)
sh_binary(
name = "gen_compile_commands",
srcs = ["gen_compile_commands.sh"],
)