blob: 7c69bfb7999dfce3df9e8b639a320b2471a3d984 [file] [log] [blame]
Brian Silvermand4aea1d2015-12-09 00:24:18 -05001py_binary(
Austin Schuhdde64052019-12-11 20:28:00 -08002 name = "generate_compile_command",
3 srcs = [
4 "generate_compile_command.py",
5 ],
Philipp Schraderdada1072020-11-24 11:34:46 -08006 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhdde64052019-12-11 20:28:00 -08007 deps = [
8 "//third_party/bazel:extra_actions_proto_py",
9 ],
Brian Silvermand4aea1d2015-12-09 00:24:18 -050010)
11
12action_listener(
Austin Schuhdde64052019-12-11 20:28:00 -080013 name = "generate_compile_commands_listener",
14 extra_actions = [":generate_compile_commands_action"],
15 mnemonics = [
16 "CppCompile",
17 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080018 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhdde64052019-12-11 20:28:00 -080019 visibility = ["//visibility:public"],
Brian Silvermand4aea1d2015-12-09 00:24:18 -050020)
21
22extra_action(
Austin Schuhdde64052019-12-11 20:28:00 -080023 name = "generate_compile_commands_action",
24 cmd = "$(location :generate_compile_command) $(EXTRA_ACTION_FILE)" +
25 " $(output $(ACTION_ID)_compile_command)",
26 out_templates = [
27 "$(ACTION_ID)_compile_command",
28 ],
Philipp Schraderdada1072020-11-24 11:34:46 -080029 target_compatible_with = ["@platforms//os:linux"],
Austin Schuhdde64052019-12-11 20:28:00 -080030 tools = [
31 ":generate_compile_command",
32 ],
Brian Silvermand4aea1d2015-12-09 00:24:18 -050033)