Brian Silverman | d4aea1d | 2015-12-09 00:24:18 -0500 | [diff] [blame] | 1 | py_binary( |
Austin Schuh | dde6405 | 2019-12-11 20:28:00 -0800 | [diff] [blame] | 2 | name = "generate_compile_command", |
| 3 | srcs = [ |
| 4 | "generate_compile_command.py", |
| 5 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 6 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | dde6405 | 2019-12-11 20:28:00 -0800 | [diff] [blame] | 7 | deps = [ |
| 8 | "//third_party/bazel:extra_actions_proto_py", |
| 9 | ], |
Brian Silverman | d4aea1d | 2015-12-09 00:24:18 -0500 | [diff] [blame] | 10 | ) |
| 11 | |
| 12 | action_listener( |
Austin Schuh | dde6405 | 2019-12-11 20:28:00 -0800 | [diff] [blame] | 13 | name = "generate_compile_commands_listener", |
| 14 | extra_actions = [":generate_compile_commands_action"], |
| 15 | mnemonics = [ |
| 16 | "CppCompile", |
| 17 | ], |
Philipp Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 18 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | dde6405 | 2019-12-11 20:28:00 -0800 | [diff] [blame] | 19 | visibility = ["//visibility:public"], |
Brian Silverman | d4aea1d | 2015-12-09 00:24:18 -0500 | [diff] [blame] | 20 | ) |
| 21 | |
| 22 | extra_action( |
Austin Schuh | dde6405 | 2019-12-11 20:28:00 -0800 | [diff] [blame] | 23 | 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 Schrader | dada107 | 2020-11-24 11:34:46 -0800 | [diff] [blame] | 29 | target_compatible_with = ["@platforms//os:linux"], |
Austin Schuh | dde6405 | 2019-12-11 20:28:00 -0800 | [diff] [blame] | 30 | tools = [ |
| 31 | ":generate_compile_command", |
| 32 | ], |
Brian Silverman | d4aea1d | 2015-12-09 00:24:18 -0500 | [diff] [blame] | 33 | ) |