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

Commit 3e53aa2

Browse files
googlewaltswiple-rules-gardener
authored andcommitted
Use cpp fragment, instead of objc fragment, to determine whether to generate 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
1 parent e4912a3 commit 3e53aa2

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

swift/internal/features.bzl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ def configure_features(
105105
_enabled_features = requestable_features,
106106
)
107107

108-
def features_for_build_modes(ctx, objc_fragment = None):
108+
def features_for_build_modes(ctx, cpp_fragment = None):
109109
"""Returns a list of Swift toolchain features for current build modes.
110110
111111
This function explicitly breaks the "don't pass `ctx` as an argument"
@@ -114,7 +114,7 @@ def features_for_build_modes(ctx, objc_fragment = None):
114114
115115
Args:
116116
ctx: The current rule context.
117-
objc_fragment: The Objective-C configuration fragment, if available.
117+
cpp_fragment: The Cpp configuration fragment, if available.
118118
119119
Returns:
120120
A list of Swift toolchain features to enable.
@@ -126,7 +126,7 @@ def features_for_build_modes(ctx, objc_fragment = None):
126126
features.append(SWIFT_FEATURE_COVERAGE)
127127
if compilation_mode in ("dbg", "fastbuild"):
128128
features.append(SWIFT_FEATURE_ENABLE_TESTING)
129-
if objc_fragment and objc_fragment.generate_dsym:
129+
if cpp_fragment and cpp_fragment.apple_generate_dsym:
130130
features.append(SWIFT_FEATURE_FULL_DEBUG_INFO)
131131
return features
132132

swift/internal/xcode_swift_toolchain.bzl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ def _xcode_swift_toolchain_impl(ctx):
652652
# version.
653653
requested_features = features_for_build_modes(
654654
ctx,
655-
objc_fragment = ctx.fragments.objc,
655+
cpp_fragment = ctx.fragments.cpp,
656656
) + features_from_swiftcopts(swiftcopts = ctx.fragments.swift.copts())
657657
requested_features.extend(ctx.features)
658658
requested_features.append(SWIFT_FEATURE_BUNDLED_XCTESTS)
@@ -813,6 +813,7 @@ for incremental compilation using a persistent mode.
813813
doc = "Represents a Swift compiler toolchain provided by Xcode.",
814814
fragments = [
815815
"apple",
816+
"cpp",
816817
"objc",
817818
"swift",
818819
],

0 commit comments

Comments
 (0)