-
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.
Implement linker_param_file as cc_args
BEGIN_PUBLIC Implement linker_param_file as cc_args Implements the linker_param_file feature as cc_args rules. END_PUBLIC PiperOrigin-RevId: 671762576 Change-Id: Ic6bd3ad3b059599c796680cdb4e2b63f6929b8a9
- Loading branch information
1 parent
9333569
commit cf6ccb9
Showing
5 changed files
with
49 additions
and
1 deletion.
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,26 @@ | ||
load("//cc/toolchains:args.bzl", "cc_args") | ||
load("//cc/toolchains:args_list.bzl", "cc_args_list") | ||
|
||
package(default_visibility = ["//visibility:private"]) | ||
|
||
cc_args_list( | ||
name = "linker_param_file", | ||
args = [":use_param_file"], | ||
visibility = ["//visibility:public"], | ||
) | ||
|
||
cc_args( | ||
name = "use_param_file", | ||
actions = [ | ||
"//cc/toolchains/actions:cpp_link_executable", | ||
"//cc/toolchains/actions:cpp_link_dynamic_library", | ||
"//cc/toolchains/actions:cpp_link_nodeps_dynamic_library", | ||
"//cc/toolchains/actions:lto_index_for_executable", | ||
"//cc/toolchains/actions:lto_index_for_dynamic_library", | ||
"//cc/toolchains/actions:lto_index_for_nodeps_dynamic_library", | ||
"//cc/toolchains/actions:cpp_link_static_library", | ||
], | ||
args = ["@{param_file}"], | ||
format = {"param_file": "//cc/toolchains/variables:linker_param_file"}, | ||
requires_not_none = "//cc/toolchains/variables:linker_param_file", | ||
) |
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
15 changes: 15 additions & 0 deletions
15
tests/rule_based_toolchain/legacy_features_as_args/goldens/unix/linker_param_file.textproto
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,15 @@ | ||
enabled: false | ||
flag_sets { | ||
actions: "c++-link-dynamic-library" | ||
actions: "c++-link-executable" | ||
actions: "c++-link-nodeps-dynamic-library" | ||
actions: "c++-link-static-library" | ||
actions: "lto-index-for-dynamic-library" | ||
actions: "lto-index-for-executable" | ||
actions: "lto-index-for-nodeps-dynamic-library" | ||
flag_groups { | ||
expand_if_available: "linker_param_file" | ||
flags: "@%{linker_param_file}" | ||
} | ||
} | ||
name: "linker_param_file_test" |