Skip to content

Commit

Permalink
swift_import: always link the import.
Browse files Browse the repository at this point in the history
`swift_library` is also moving in this direction.

SwiftPM works by linking all the .o files, so this should end up in a state
that seem users familiar with SwiftPM/Xcode will expect. Otherwise an `@objc`
class might not be findable by name only, or a protocol conformance might not
get included leading to confusing runtime problems.

PiperOrigin-RevId: 527908878
  • Loading branch information
thomasvl authored and swiple-rules-gardener committed Apr 28, 2023
1 parent ef7ba6d commit 2cc542a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions swift/swift_import.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ def _swift_import_impl(ctx):
libraries_to_link = [
cc_common.create_library_to_link(
actions = ctx.actions,
alwayslink = True,
cc_toolchain = swift_toolchain.cc_toolchain_info,
feature_configuration = get_cc_feature_configuration(
feature_configuration,
Expand Down

0 comments on commit 2cc542a

Please sign in to comment.