Skip to content

Commit

Permalink
Fix imported_library handling on Bazel 5 (#1033)
Browse files Browse the repository at this point in the history
  • Loading branch information
brentleyjones authored Mar 24, 2023
1 parent df2d1a6 commit 74d7422
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion swift/internal/linking.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -403,13 +403,28 @@ def register_link_binary_action(
objc.static_framework_names.to_list(),
))

is_bazel_6 = hasattr(apple_common, "link_multi_arch_static_library")
if is_bazel_6:
additional_inputs = objc.static_framework_file
else:
additional_inputs = depset(
transitive = [
objc.static_framework_file,
objc.imported_library,
],
)
dep_link_flags.extend([
lib.path
for lib in objc.imported_library.to_list()
])

linking_contexts.append(
cc_common.create_linking_context(
linker_inputs = depset([
cc_common.create_linker_input(
owner = owner,
user_link_flags = dep_link_flags,
additional_inputs = objc.static_framework_file,
additional_inputs = additional_inputs,
),
]),
),
Expand Down

0 comments on commit 74d7422

Please sign in to comment.