Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions swift/internal/features.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -96,17 +96,21 @@ def configure_features(
passed to other `swift_common` functions. Note that the structure of
this value should otherwise not be relied on or inspected directly.
"""
requested_features = list(requested_features)
unsupported_features = list(unsupported_features)

# Always disable these two features so that any `cc_common` APIs called by
# `swift_common` APIs don't cause certain actions to be created (for
# example, when using `cc_common.compile` to create the compilation context
# for a generated header).
unsupported_features = list(unsupported_features)
unsupported_features.extend([
"cc_include_scanning",
"parse_headers",
])

if ctx.configuration.coverage_enabled and ctx.coverage_instrumented():
requested_features.append(SWIFT_FEATURE_COVERAGE)

# HACK: This is the only way today to check whether the caller is inside an
# aspect. We have to do this because accessing `ctx.aspect_ids` halts the
# build if called from outside an aspect, but we can't use `hasattr` to
Expand Down Expand Up @@ -180,8 +184,6 @@ def features_for_build_modes(ctx, cpp_fragment = None):
compilation_mode = ctx.var["COMPILATION_MODE"]
features = []
features.append("swift.{}".format(compilation_mode))
if ctx.configuration.coverage_enabled:
features.append(SWIFT_FEATURE_COVERAGE)
if compilation_mode in ("dbg", "fastbuild"):
features.append(SWIFT_FEATURE_ENABLE_TESTING)
if cpp_fragment and cpp_fragment.apple_generate_dsym:
Expand Down