Skip to content

Commit

Permalink
Pass language = "objc" to cc_common.configure_features when targe…
Browse files Browse the repository at this point in the history
…ting an Apple platform.

PiperOrigin-RevId: 559395644
  • Loading branch information
allevato authored and swiple-rules-gardener committed Aug 23, 2023
1 parent c58d81a commit 191ecad
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
4 changes: 1 addition & 3 deletions swift/internal/features.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -95,10 +95,7 @@ def configure_features(
# for a generated header).
unsupported_features = list(unsupported_features)
unsupported_features.extend([
# Avoid making the `grep_includes` tool a requirement of Swift
# compilation APIs/rules that generate a header.
"cc_include_scanning",
# Don't register parse-header actions for generated headers.
"parse_headers",
])

Expand All @@ -119,6 +116,7 @@ def configure_features(
cc_feature_configuration = cc_common.configure_features(
ctx = ctx,
cc_toolchain = swift_toolchain.cc_toolchain_info,
language = swift_toolchain.cc_language,
requested_features = all_requestable_features,
unsupported_features = all_unsupported_features,
)
Expand Down
4 changes: 4 additions & 0 deletions swift/providers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ that use the toolchain.
fields = {
"action_configs": """\
This field is an internal implementation detail of the build rules.
""",
"cc_language": """\
The `language` that should be passed to `cc_common` APIs that take it as an
argument.
""",
"cc_toolchain_info": """\
The `cc_common.CcToolchainInfo` provider from the Bazel C++ toolchain that this
Expand Down
1 change: 1 addition & 0 deletions swift/toolchains/xcode_swift_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -631,6 +631,7 @@ def _xcode_swift_toolchain_impl(ctx):

swift_toolchain_info = SwiftToolchainInfo(
action_configs = all_action_configs,
cc_language = "objc",
cc_toolchain_info = cc_toolchain,
clang_implicit_deps_providers = collect_implicit_deps_providers(
ctx.attr.clang_implicit_deps,
Expand Down

1 comment on commit 191ecad

@brentleyjones
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.