Skip to content

Commit

Permalink
Add disable system index feature (bazelbuild#563)
Browse files Browse the repository at this point in the history
  • Loading branch information
keith authored Feb 8, 2021
1 parent 1ef4601 commit 18b48c2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
13 changes: 13 additions & 0 deletions swift/internal/compiling.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ load(
"SWIFT_FEATURE_COVERAGE_PREFIX_MAP",
"SWIFT_FEATURE_DBG",
"SWIFT_FEATURE_DEBUG_PREFIX_MAP",
"SWIFT_FEATURE_DISABLE_SYSTEM_INDEX",
"SWIFT_FEATURE_EMIT_C_MODULE",
"SWIFT_FEATURE_EMIT_SWIFTINTERFACE",
"SWIFT_FEATURE_ENABLE_BATCH_MODE",
Expand Down Expand Up @@ -717,6 +718,18 @@ def compile_action_configs():
configurators = [_index_while_building_configurator],
features = [SWIFT_FEATURE_INDEX_WHILE_BUILDING],
),
swift_toolchain_config.action_config(
actions = [swift_action_names.COMPILE],
configurators = [
swift_toolchain_config.add_arg(
"-index-ignore-system-modules",
),
],
features = [
SWIFT_FEATURE_INDEX_WHILE_BUILDING,
SWIFT_FEATURE_DISABLE_SYSTEM_INDEX,
],
),

# User-defined conditional compilation flags (defined for Swift; those
# passed directly to ClangImporter are handled above).
Expand Down
3 changes: 3 additions & 0 deletions swift/internal/feature_names.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ SWIFT_FEATURE_FULL_DEBUG_INFO = "swift.full_debug_info"
# If enabled, the compilation action for a target will produce an index store.
SWIFT_FEATURE_INDEX_WHILE_BUILDING = "swift.index_while_building"

# If enabled the compilation action will not produce indexes for system modules.
SWIFT_FEATURE_DISABLE_SYSTEM_INDEX = "swift.disable_system_index"

# If enabled, Swift libraries, binaries, and tests will only have automatic
# dependencies on the targets provided by the toolchain's
# `required_implicit_deps` field but not those in the `optional_implicit_deps`
Expand Down

0 comments on commit 18b48c2

Please sign in to comment.