Skip to content

Commit 18b48c2

Browse files
authored
Add disable system index feature (#563)
1 parent 1ef4601 commit 18b48c2

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

swift/internal/compiling.bzl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ load(
3636
"SWIFT_FEATURE_COVERAGE_PREFIX_MAP",
3737
"SWIFT_FEATURE_DBG",
3838
"SWIFT_FEATURE_DEBUG_PREFIX_MAP",
39+
"SWIFT_FEATURE_DISABLE_SYSTEM_INDEX",
3940
"SWIFT_FEATURE_EMIT_C_MODULE",
4041
"SWIFT_FEATURE_EMIT_SWIFTINTERFACE",
4142
"SWIFT_FEATURE_ENABLE_BATCH_MODE",
@@ -717,6 +718,18 @@ def compile_action_configs():
717718
configurators = [_index_while_building_configurator],
718719
features = [SWIFT_FEATURE_INDEX_WHILE_BUILDING],
719720
),
721+
swift_toolchain_config.action_config(
722+
actions = [swift_action_names.COMPILE],
723+
configurators = [
724+
swift_toolchain_config.add_arg(
725+
"-index-ignore-system-modules",
726+
),
727+
],
728+
features = [
729+
SWIFT_FEATURE_INDEX_WHILE_BUILDING,
730+
SWIFT_FEATURE_DISABLE_SYSTEM_INDEX,
731+
],
732+
),
720733

721734
# User-defined conditional compilation flags (defined for Swift; those
722735
# passed directly to ClangImporter are handled above).

swift/internal/feature_names.bzl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,9 @@ SWIFT_FEATURE_FULL_DEBUG_INFO = "swift.full_debug_info"
102102
# If enabled, the compilation action for a target will produce an index store.
103103
SWIFT_FEATURE_INDEX_WHILE_BUILDING = "swift.index_while_building"
104104

105+
# If enabled the compilation action will not produce indexes for system modules.
106+
SWIFT_FEATURE_DISABLE_SYSTEM_INDEX = "swift.disable_system_index"
107+
105108
# If enabled, Swift libraries, binaries, and tests will only have automatic
106109
# dependencies on the targets provided by the toolchain's
107110
# `required_implicit_deps` field but not those in the `optional_implicit_deps`

0 commit comments

Comments
 (0)