Skip to content

Commit 3025d8f

Browse files
authored
Insert -plugin-path for testing macros location when building tests (#1555)
1 parent 80ea837 commit 3025d8f

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

swift/toolchains/config/compile_config.bzl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,13 @@ def compile_action_configs(
880880
# capture these for debug builds.
881881
not_features = [SWIFT_FEATURE_OPT],
882882
),
883+
ActionConfigInfo(
884+
actions = [
885+
SWIFT_ACTION_COMPILE,
886+
SWIFT_ACTION_DERIVE_FILES,
887+
],
888+
configurators = [_plugin_search_paths_configurator],
889+
),
883890

884891
# swift-symbolgraph-extract doesn't yet support explicit Swift module maps.
885892
ActionConfigInfo(
@@ -1989,6 +1996,14 @@ def _macro_expansion_configurator(prerequisites, args):
19891996
format = "-Xwrapped-swift=-macro-expansion-dir=%s",
19901997
)
19911998

1999+
def _plugin_search_paths_configurator(prerequisites, args):
2000+
"""Adds plugin search paths to the command line."""
2001+
if prerequisites.include_dev_srch_paths:
2002+
args.add(
2003+
"-plugin-path",
2004+
"__BAZEL_XCODE_DEVELOPER_DIR__/Toolchains/XcodeDefault.xctoolchain/usr/lib/swift/host/plugins/testing",
2005+
)
2006+
19922007
def _dependencies_swiftmodules_vfsoverlay_configurator(prerequisites, args, is_frontend = False):
19932008
"""Provides a single `.swiftmodule` search path using a VFS overlay."""
19942009
swiftmodules = prerequisites.transitive_swiftmodules

0 commit comments

Comments
 (0)