Skip to content

Commit 69859b6

Browse files
committed
[Tests][SwiftPM] Also include _get_toolchain_path in swiftpm.py.
We need the `_get_toolchain_path` function in `swiftpm.py` also.
1 parent e366a46 commit 69859b6

File tree

1 file changed

+13
-0
lines changed
  • utils/swift_build_support/swift_build_support/products

1 file changed

+13
-0
lines changed

utils/swift_build_support/swift_build_support/products/swiftpm.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,3 +182,16 @@ def get_dependencies(cls):
182182
xctest.XCTest,
183183
llbuild.LLBuild,
184184
swift_testing.SwiftTesting]
185+
186+
def _get_toolchain_path(host_target, product, args):
187+
# TODO check if we should prefer using product.install_toolchain_path
188+
# this logic initially was inside run_build_script_helper
189+
# and was factored out so it can be used in testing as well
190+
191+
toolchain_path = product.host_install_destdir(host_target)
192+
if platform.system() == 'Darwin':
193+
# The prefix is an absolute path, so concatenate without os.path.
194+
toolchain_path += \
195+
targets.darwin_toolchain_prefix(args.install_prefix)
196+
197+
return toolchain_path

0 commit comments

Comments
 (0)