Skip to content

Commit a61d220

Browse files
authored
Merge pull request #29911 from compnerd/pythonkit-new-compiler
build: build PythonKit with just built toolchain
2 parents 092fb33 + 01f9321 commit a61d220

File tree

1 file changed

+8
-1
lines changed
  • utils/swift_build_support/swift_build_support/products

1 file changed

+8
-1
lines changed

utils/swift_build_support/swift_build_support/products/pythonkit.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,11 @@
1010
#
1111
# ----------------------------------------------------------------------------
1212

13+
import os
14+
1315
from . import product
1416
from .. import shell
17+
from .. import targets
1518

1619

1720
class PythonKit(product.Product):
@@ -27,14 +30,18 @@ def should_build(self, host_target):
2730
return True
2831

2932
def build(self, host_target):
33+
toolchain_path = targets.toolchain_path(self.args.install_destdir,
34+
self.args.install_prefix)
35+
swiftc = os.path.join(toolchain_path, 'usr', 'bin', 'swift')
36+
3037
shell.call([
3138
self.toolchain.cmake,
3239
'-G', 'Ninja',
3340
'-D', 'BUILD_SHARED_LIBS=YES',
3441
'-D', 'CMAKE_INSTALL_PREFIX={}/usr'.format(
3542
self.args.install_destdir),
3643
'-D', 'CMAKE_MAKE_PROGRAM={}'.format(self.toolchain.ninja),
37-
'-D', 'CMAKE_Swift_COMPILER={}'.format(self.toolchain.swiftc),
44+
'-D', 'CMAKE_Swift_COMPILER={}'.format(swiftc),
3845
'-B', self.build_dir,
3946
'-S', self.source_dir,
4047
])

0 commit comments

Comments
 (0)