-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Copybara Import from #324 BEGIN_PUBLIC Add strip_flags (#324) Previously the strip action appeared to be entirely invalid since no flags were passed to strip. I believe this is because the strip action was configured in the legacy feature code without any extra features, just directly on the action. Closes #324 END_PUBLIC COPYBARA_INTEGRATE_REVIEW=#324 from keith:ks/add-strip_flags 79f1143 PiperOrigin-RevId: 726219472 Change-Id: Icb7685353896d0d4b392432637fa8cf64dc61c0d
- Loading branch information
1 parent
4ac36f7
commit 9c91c03
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
load("//cc/toolchains:args.bzl", "cc_args") | ||
load("//cc/toolchains:args_list.bzl", "cc_args_list") | ||
load("//cc/toolchains:feature.bzl", "cc_feature") | ||
|
||
package(default_visibility = ["//visibility:public"]) | ||
|
||
cc_feature( | ||
name = "feature", | ||
args = [":strip_flags"], | ||
# This does not override a feature since these arguments are directly bound | ||
# to the strip action in CppActionConfigs.java. | ||
feature_name = "strip_flags_feature", | ||
) | ||
|
||
cc_args_list( | ||
name = "strip_flags", | ||
args = [ | ||
":strip_debug", | ||
":preserve_dates", | ||
":output_file", | ||
":input_file", | ||
], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_args( | ||
name = "strip_debug", | ||
actions = ["//cc/toolchains/actions:strip"], | ||
args = ["-S"], | ||
) | ||
|
||
cc_args( | ||
name = "preserve_dates", | ||
actions = ["//cc/toolchains/actions:strip"], | ||
args = select({ | ||
"@platforms//os:macos": [], | ||
"//conditions:default": ["-p"], | ||
}), | ||
) | ||
|
||
cc_args( | ||
name = "output_file", | ||
actions = ["//cc/toolchains/actions:strip"], | ||
args = [ | ||
"-o", | ||
"{output_file}", | ||
], | ||
format = {"output_file": "//cc/toolchains/variables:output_file"}, | ||
requires_not_none = "//cc/toolchains/variables:output_file", | ||
) | ||
|
||
cc_args( | ||
name = "input_file", | ||
actions = ["//cc/toolchains/actions:strip"], | ||
args = ["{input_file}"], | ||
format = {"input_file": "//cc/toolchains/variables:input_file"}, | ||
) |