@@ -95,21 +95,17 @@ def _register_static_library_link_action(
95
95
)
96
96
97
97
def register_libraries_to_link (
98
- owning_label ,
99
98
actions ,
100
99
alwayslink ,
101
100
cc_feature_configuration ,
102
101
is_dynamic ,
103
102
is_static ,
104
103
library_name ,
105
104
objects ,
106
- swift_toolchain ,
107
- user_link_flags ,
108
- additional_inputs ):
105
+ swift_toolchain ):
109
106
"""Declares the requested libraries and registers actions to link them.
110
107
111
108
Args:
112
- owning_label: Label executing rule (i.e., ctx.label).
113
109
actions: The object used to register actions.
114
110
alwayslink: If True, create a static library that should be
115
111
always-linked (having a `.lo` extension instead of `.a`). This
@@ -124,11 +120,9 @@ def register_libraries_to_link(
124
120
linked.
125
121
swift_toolchain: The Swift toolchain provider to use when constructing
126
122
the action.
127
- user_link_flags: Extra link flags to be passed with the library.
128
- additional_inputs: Extra inputs for a link action involving the library.
129
123
130
124
Returns:
131
- A `LinkerInput ` object containing the libraries that were created.
125
+ A `LibraryToLink ` object containing the libraries that were created.
132
126
"""
133
127
dynamic_library = None
134
128
if is_dynamic :
@@ -151,24 +145,16 @@ def register_libraries_to_link(
151
145
else :
152
146
static_library = None
153
147
154
- return cc_common .create_linker_input (
155
- owner = owning_label ,
156
- libraries = depset (direct = [
157
- cc_common .create_library_to_link (
158
- actions = actions ,
159
- alwayslink = alwayslink ,
160
- cc_toolchain = swift_toolchain .cc_toolchain_info ,
161
- feature_configuration = cc_feature_configuration ,
162
- pic_static_library = static_library ,
163
- dynamic_library = dynamic_library ,
164
- ),
165
- ]),
166
- additional_inputs = depset (direct = additional_inputs ),
167
- user_link_flags = depset (direct = user_link_flags ),
148
+ return cc_common .create_library_to_link (
149
+ actions = actions ,
150
+ alwayslink = alwayslink ,
151
+ cc_toolchain = swift_toolchain .cc_toolchain_info ,
152
+ feature_configuration = cc_feature_configuration ,
153
+ pic_static_library = static_library ,
154
+ dynamic_library = dynamic_library ,
168
155
)
169
156
170
157
def register_link_binary_action (
171
- owning_label ,
172
158
actions ,
173
159
additional_inputs ,
174
160
additional_linking_contexts ,
@@ -184,7 +170,6 @@ def register_link_binary_action(
184
170
"""Registers an action that invokes the linker to produce a binary.
185
171
186
172
Args:
187
- owning_label: Label of the rule creating the link action.
188
173
actions: The object used to register actions.
189
174
additional_inputs: A list of additional inputs to the link action,
190
175
such as those used in `$(location ...)` substitution, linker
@@ -246,12 +231,7 @@ def register_link_binary_action(
246
231
247
232
linking_contexts .append (
248
233
cc_common .create_linking_context (
249
- linker_inputs = depset (direct = [
250
- cc_common .create_linker_input (
251
- owner = owning_label ,
252
- user_link_flags = depset (direct = dep_link_flags ),
253
- ),
254
- ])
234
+ user_link_flags = dep_link_flags ,
255
235
),
256
236
)
257
237
0 commit comments