aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoogler <noreply@google.com>2024-03-26 22:49:54 -0700
committerCopybara-Service <copybara-worker@google.com>2024-03-26 22:50:35 -0700
commit4a62c693309887664cb733245d1c74f17a992942 (patch)
tree19f038d666f59baa356bd67b4efb2edb9387abe8
parent991cdf09a92386d22de007280d72b0aca2fb4c5f (diff)
downloadbazelbuild-rules_cc-4a62c693309887664cb733245d1c74f17a992942.tar.gz
Add additional actions that are not specified in action_names.bzl.
BEGIN_PUBLIC Add additional actions that are not specified in action_names.bzl. These are mostly taken from https://github.com/bazelbuild/bazel/blob/master/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionNames.java. These also include some actions that have explicitly been removed from CppActionNames, because those actions are still in use elsewhere (eg. https://github.com/bazelbuild/bazel/blob/9a333bc59e04e3c926121b11eb97547ba823c6ed/src/main/java/com/google/devtools/build/lib/rules/cpp/CppActionConfigs.java#L974). END_PUBLIC PiperOrigin-RevId: 619420983 Change-Id: I1f5eb1c0e43fb1563db9065ebc46f70bf8d06fc5
-rw-r--r--cc/toolchains/actions.bzl3
-rw-r--r--cc/toolchains/actions/BUILD37
2 files changed, 39 insertions, 1 deletions
diff --git a/cc/toolchains/actions.bzl b/cc/toolchains/actions.bzl
index 772e460..fc91787 100644
--- a/cc/toolchains/actions.bzl
+++ b/cc/toolchains/actions.bzl
@@ -50,7 +50,7 @@ cc_action_type(
)
def _cc_action_type_set_impl(ctx):
- if not ctx.attr.actions:
+ if not ctx.attr.actions and not ctx.attr.allow_empty:
fail("Each cc_action_type_set must contain at least one action type.")
return [ActionTypeSetInfo(
label = ctx.label,
@@ -77,6 +77,7 @@ cc_action_type_set(
mandatory = True,
doc = "A list of cc_action_type or cc_action_type_set",
),
+ "allow_empty": attr.bool(default = False),
},
provides = [ActionTypeSetInfo],
)
diff --git a/cc/toolchains/actions/BUILD b/cc/toolchains/actions/BUILD
index 1286999..e122f5c 100644
--- a/cc/toolchains/actions/BUILD
+++ b/cc/toolchains/actions/BUILD
@@ -44,6 +44,11 @@ cc_action_type(
)
cc_action_type(
+ name = "cpp_header_analysis",
+ action_name = "c++-header-analysis",
+)
+
+cc_action_type(
name = "cpp_header_parsing",
action_name = ACTION_NAMES.cpp_header_parsing,
)
@@ -114,6 +119,29 @@ cc_action_type(
)
cc_action_type(
+ name = "objcopy_embed_data",
+ action_name = "objcopy_embed_data",
+)
+
+# ld_embed_data is only available within google.
+cc_action_type(
+ # # copybara-comment-this-out-please
+ name = "ld_embed_data_action", # # copybara-comment-this-out-please
+ action_name = "ld_embed_data", # # copybara-comment-this-out-please
+) # # copybara-comment-this-out-please
+
+# To make things simple, both internal and external rules will refer to
+# ld_embed_data, but externally it will evaluate to the empty set.
+cc_action_type_set(
+ name = "ld_embed_data",
+ actions = [
+ ":ld_embed_data_action", # # copybara-comment-this-out-please
+ ],
+ allow_empty = True,
+ visibility = ["//cc/toolchains:__subpackages__"],
+)
+
+cc_action_type(
name = "objc_compile",
action_name = ACTION_NAMES.objc_compile,
)
@@ -134,6 +162,11 @@ cc_action_type(
)
cc_action_type(
+ name = "objcpp_executable",
+ action_name = "objc++-executable",
+)
+
+cc_action_type(
name = "clif_match",
action_name = ACTION_NAMES.clif_match,
)
@@ -224,6 +257,7 @@ cc_action_type_set(
":linkstamp_compile",
":cc_flags_make_variable",
":cpp_module_codegen",
+ ":cpp_header_analysis",
":cpp_header_parsing",
":cpp_module_compile",
":assemble",
@@ -238,10 +272,13 @@ cc_action_type_set(
":cpp_link_nodeps_dynamic_library",
":cpp_link_static_library",
":strip",
+ ":objcopy_embed_data",
+ ":ld_embed_data",
":objc_compile",
":objc_executable",
":objc_fully_link",
":objcpp_compile",
+ ":objcpp_executable",
":clif_match",
],
)