Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
Use cpp fragment, instead of objc fragment, to determine whether to g…
Browse files Browse the repository at this point in the history
…enerate dsym

The information is identical, and we would like to migrate all uses to
cpp fragment so that we can delete the info in objc fragment.

PiperOrigin-RevId: 370899517
  • Loading branch information
googlewalt authored and swiple-rules-gardener committed Apr 28, 2021
1 parent e4912a3 commit 3e53aa2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions swift/internal/features.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def configure_features(
_enabled_features = requestable_features,
)

def features_for_build_modes(ctx, objc_fragment = None):
def features_for_build_modes(ctx, cpp_fragment = None):
"""Returns a list of Swift toolchain features for current build modes.
This function explicitly breaks the "don't pass `ctx` as an argument"
Expand All @@ -114,7 +114,7 @@ def features_for_build_modes(ctx, objc_fragment = None):
Args:
ctx: The current rule context.
objc_fragment: The Objective-C configuration fragment, if available.
cpp_fragment: The Cpp configuration fragment, if available.
Returns:
A list of Swift toolchain features to enable.
Expand All @@ -126,7 +126,7 @@ def features_for_build_modes(ctx, objc_fragment = None):
features.append(SWIFT_FEATURE_COVERAGE)
if compilation_mode in ("dbg", "fastbuild"):
features.append(SWIFT_FEATURE_ENABLE_TESTING)
if objc_fragment and objc_fragment.generate_dsym:
if cpp_fragment and cpp_fragment.apple_generate_dsym:
features.append(SWIFT_FEATURE_FULL_DEBUG_INFO)
return features

Expand Down
3 changes: 2 additions & 1 deletion swift/internal/xcode_swift_toolchain.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ def _xcode_swift_toolchain_impl(ctx):
# version.
requested_features = features_for_build_modes(
ctx,
objc_fragment = ctx.fragments.objc,
cpp_fragment = ctx.fragments.cpp,
) + features_from_swiftcopts(swiftcopts = ctx.fragments.swift.copts())
requested_features.extend(ctx.features)
requested_features.append(SWIFT_FEATURE_BUNDLED_XCTESTS)
Expand Down Expand Up @@ -813,6 +813,7 @@ for incremental compilation using a persistent mode.
doc = "Represents a Swift compiler toolchain provided by Xcode.",
fragments = [
"apple",
"cpp",
"objc",
"swift",
],
Expand Down

0 comments on commit 3e53aa2

Please sign in to comment.