Skip to content

Commit

Permalink
add library_interface_uses_swiftinterface to swift_toolchain
Browse files Browse the repository at this point in the history
Summary: Add a swift toolchain attribute and provider field to control if builds should use swiftinterface files or not.

Reviewed By: maxovtsin

Differential Revision: D66710273

fbshipit-source-id: 4e3fb9cbfc698b269b9bc39e158a3b8802e72502
  • Loading branch information
rmaz authored and facebook-github-bot committed Dec 4, 2024
1 parent 82843d9 commit bde1837
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions apple/swift/swift_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def swift_toolchain_impl(ctx):
architecture = ctx.attrs.architecture,
compiler = cmd_args(ctx.attrs._swiftc_wrapper[RunInfo]).add(ctx.attrs.swiftc[RunInfo]),
compiler_flags = ctx.attrs.swiftc_flags,
library_interface_uses_swiftinterface = ctx.attrs._library_interface_uses_swiftinterface,
mk_swift_comp_db = ctx.attrs.make_swift_comp_db,
mk_swift_interface = cmd_args(ctx.attrs._swiftc_wrapper[RunInfo]).add(ctx.attrs.make_swift_interface[RunInfo]),
object_format = SwiftObjectFormat(ctx.attrs.object_format) if ctx.attrs.object_format else SwiftObjectFormat("object"),
Expand Down
1 change: 1 addition & 0 deletions apple/swift/swift_toolchain_types.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ SwiftToolchainInfo = provider(
"can_toolchain_emit_obj_c_header_textually": provider_field(typing.Any, default = None), # bool
"compiler": provider_field(typing.Any, default = None),
"compiler_flags": provider_field(typing.Any, default = None),
"library_interface_uses_swiftinterface": provider_field(bool),
"mk_swift_comp_db": provider_field(typing.Any, default = None),
"mk_swift_interface": provider_field(typing.Any, default = None),
"object_format": provider_field(typing.Any, default = None), # "SwiftObjectFormat"
Expand Down
4 changes: 4 additions & 0 deletions decls/apple_rules.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -1032,6 +1032,10 @@ swift_toolchain = prelude_rule(
"swiftc_flags": attrs.list(attrs.arg(), default = []),
"swift_experimental_features": attrs.dict(key = attrs.enum(SwiftVersion), value = attrs.list(attrs.string()), sorted = False, default = _swift_version_feature_map),
"swift_upcoming_features": attrs.dict(key = attrs.enum(SwiftVersion), value = attrs.list(attrs.string()), sorted = False, default = _swift_version_feature_map),
"_library_interface_uses_swiftinterface": attrs.bool(default = select({
"DEFAULT": False,
"config//features/apple:swift_library_interface_uses_swiftinterface_enabled": True,
})),
}
),
)
Expand Down

0 comments on commit bde1837

Please sign in to comment.