@@ -96,17 +96,21 @@ def configure_features(
96
96
passed to other `swift_common` functions. Note that the structure of
97
97
this value should otherwise not be relied on or inspected directly.
98
98
"""
99
+ requested_features = list (requested_features )
100
+ unsupported_features = list (unsupported_features )
99
101
100
102
# Always disable these two features so that any `cc_common` APIs called by
101
103
# `swift_common` APIs don't cause certain actions to be created (for
102
104
# example, when using `cc_common.compile` to create the compilation context
103
105
# for a generated header).
104
- unsupported_features = list (unsupported_features )
105
106
unsupported_features .extend ([
106
107
"cc_include_scanning" ,
107
108
"parse_headers" ,
108
109
])
109
110
111
+ if ctx .coverage_instrumented ():
112
+ requested_features .append (SWIFT_FEATURE_COVERAGE )
113
+
110
114
# HACK: This is the only way today to check whether the caller is inside an
111
115
# aspect. We have to do this because accessing `ctx.aspect_ids` halts the
112
116
# build if called from outside an aspect, but we can't use `hasattr` to
@@ -180,8 +184,6 @@ def features_for_build_modes(ctx, cpp_fragment = None):
180
184
compilation_mode = ctx .var ["COMPILATION_MODE" ]
181
185
features = []
182
186
features .append ("swift.{}" .format (compilation_mode ))
183
- if ctx .configuration .coverage_enabled :
184
- features .append (SWIFT_FEATURE_COVERAGE )
185
187
if compilation_mode in ("dbg" , "fastbuild" ):
186
188
features .append (SWIFT_FEATURE_ENABLE_TESTING )
187
189
if cpp_fragment and cpp_fragment .apple_generate_dsym :
0 commit comments