Skip to content

Commit b6eded7

Browse files
committed
[Build] Start installing the "early" Swift Syntax into the toolchain
1 parent 2001318 commit b6eded7

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

utils/swift_build_support/swift_build_support/products/earlyswiftsyntax.py

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ def build(self, host_target):
6767
toolchain_file = self.generate_linux_toolchain_file(platform, arch)
6868
self.cmake_options.define('CMAKE_TOOLCHAIN_FILE:PATH', toolchain_file)
6969

70+
self.cmake_options.define('CMAKE_INSTALL_PREFIX:PATH', self.args.install_prefix)
7071
self.build_with_cmake(["all"], self.args.swift_build_variant, [])
7172

7273
def should_test(self, host_target):
@@ -77,17 +78,18 @@ def test(self, host_target):
7778
pass
7879

7980
def should_install(self, host_target):
80-
# This product is for the swift-syntax used with the build-directory compiler.
81-
# If a toolchain install is required, please use the SwiftSyntax (no 'Early')
82-
# product with `--swift-syntax --install-swift-syntax`.
83-
return False
81+
"""should_install() -> Bool
8482
85-
@classmethod
86-
def is_ignore_install_all_product(cls):
87-
# Ensures that `install_all` setting triggered by `--infer` does not
88-
# affect products which specify `is_ignore_install_all_product` as
89-
# True. This is useful for products which should not be installed into the
90-
# toolchain (corresponding build products that use the just-built
91-
# toolchain are the products that get installed, e.g. `swiftsyntax` to
92-
# `earlyswiftsyntax`).
93-
return True
83+
Whether or not this product should be installed with the given
84+
arguments.
85+
"""
86+
return self.args.install_all
87+
88+
def install(self, host_target):
89+
"""
90+
Perform the install phase for the product.
91+
92+
This phase might copy the artifacts from the previous phases into a
93+
destination directory.
94+
"""
95+
self.install_with_cmake(["install"], self.host_install_destdir(host_target))

0 commit comments

Comments
 (0)