diff --git a/swift/internal/features.bzl b/swift/internal/features.bzl index 6e19d7d0e..3a3f57cb9 100644 --- a/swift/internal/features.bzl +++ b/swift/internal/features.bzl @@ -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" @@ -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. @@ -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 diff --git a/swift/internal/xcode_swift_toolchain.bzl b/swift/internal/xcode_swift_toolchain.bzl index fad0dd2d4..2ad3905ac 100644 --- a/swift/internal/xcode_swift_toolchain.bzl +++ b/swift/internal/xcode_swift_toolchain.bzl @@ -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) @@ -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", ],