mirror of https://github.com/bazelbuild/rules_cc
Implement shared_flag as cc_args
BEGIN_PUBLIC Implement shared_flag as cc_args Implements the shared_flag feature as cc_args rules. END_PUBLIC PiperOrigin-RevId: 671765792 Change-Id: I0c13873ef2b5c19908cbed13c1b88b5fc957c4cd
This commit is contained in:
parent
98ab8334e7
commit
4bf8bb1f7d
|
@ -17,6 +17,7 @@ cc_feature(
|
|||
"//cc/toolchains/args/archiver_flags",
|
||||
"//cc/toolchains/args/force_pic_flags",
|
||||
"//cc/toolchains/args/linker_param_file",
|
||||
"//cc/toolchains/args/shared_flag",
|
||||
],
|
||||
feature_name = "experimental_replace_legacy_action_config_features",
|
||||
# TODO: Convert remaining items in this list into their actual args.
|
||||
|
@ -37,6 +38,5 @@ cc_feature(
|
|||
"//cc/toolchains/features/legacy:user_link_flags",
|
||||
"//cc/toolchains/features/legacy:libraries_to_link",
|
||||
"//cc/toolchains/features/legacy:runtime_library_search_directories",
|
||||
"//cc/toolchains/features/legacy:shared_flag",
|
||||
],
|
||||
)
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
load("//cc/toolchains:args.bzl", "cc_args")
|
||||
|
||||
package(default_visibility = ["//visibility:private"])
|
||||
|
||||
cc_args(
|
||||
name = "shared_flag",
|
||||
actions = [
|
||||
"//cc/toolchains/actions:cpp_link_dynamic_library",
|
||||
"//cc/toolchains/actions:cpp_link_nodeps_dynamic_library",
|
||||
"//cc/toolchains/actions:lto_index_for_dynamic_library",
|
||||
"//cc/toolchains/actions:lto_index_for_nodeps_dynamic_library",
|
||||
],
|
||||
args = ["-shared"],
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
|
@ -97,6 +97,7 @@ cc_external_feature(
|
|||
|
||||
cc_external_feature(
|
||||
name = "shared_flag",
|
||||
deprecation = "Use //cc/toolchains/args/shared_flag instead",
|
||||
feature_name = "shared_flag",
|
||||
overridable = True,
|
||||
)
|
||||
|
|
|
@ -32,3 +32,9 @@ compare_feature_implementation(
|
|||
actual_implementation = "//cc/toolchains/args/linker_param_file",
|
||||
expected = "//tests/rule_based_toolchain/legacy_features_as_args:goldens/unix/linker_param_file.textproto",
|
||||
)
|
||||
|
||||
compare_feature_implementation(
|
||||
name = "shared_flag_test",
|
||||
actual_implementation = "//cc/toolchains/args/shared_flag",
|
||||
expected = "//tests/rule_based_toolchain/legacy_features_as_args:goldens/unix/shared_flag.textproto",
|
||||
)
|
||||
|
|
|
@ -0,0 +1,11 @@
|
|||
enabled: false
|
||||
flag_sets {
|
||||
actions: "c++-link-dynamic-library"
|
||||
actions: "c++-link-nodeps-dynamic-library"
|
||||
actions: "lto-index-for-dynamic-library"
|
||||
actions: "lto-index-for-nodeps-dynamic-library"
|
||||
flag_groups {
|
||||
flags: "-shared"
|
||||
}
|
||||
}
|
||||
name: "shared_flag_test"
|
Loading…
Reference in New Issue