Skip to content

Commit a1a8d73

Browse files
[6.2][wasm] Build and install XCTest for Wasm Swift SDK (#83200)
- **Explanation**: Install static XCTest library and its Swift module files into Swift SDK for Wasm - **Scope**: Narrow, only affects Wasm Swift SDK. - **Original PRs**: #83191 - **Risk**: Low, just a change to Wasm Swift SDK - **Testing**: CI - **Reviewers**: @MaxDesiatov
1 parent b7c3cea commit a1a8d73

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

utils/swift_build_support/swift_build_support/products/wasmswiftsdk.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,25 @@ def _build_swift_testing(self, swift_host_triple, has_pthread, wasi_sysroot):
190190
shell.call([self.toolchain.cmake, '--install', '.', '--prefix', '/usr'],
191191
env={'DESTDIR': dest_dir})
192192

193+
def _build_xctest(self, swift_host_triple, has_pthread, wasi_sysroot):
194+
xctest = CMakeProduct(
195+
args=self.args,
196+
toolchain=self.toolchain,
197+
source_dir=os.path.join(
198+
os.path.dirname(self.source_dir), 'swift-corelibs-xctest'),
199+
build_dir=os.path.join(self.build_dir, 'xctest', swift_host_triple))
200+
self._append_platform_cmake_options(
201+
xctest.cmake_options, swift_host_triple, has_pthread, wasi_sysroot,
202+
extra_swift_flags=[])
203+
xctest.cmake_options.define('BUILD_SHARED_LIBS', 'FALSE')
204+
205+
xctest.build_with_cmake([], self.args.build_variant, [],
206+
prefer_native_toolchain=True)
207+
dest_dir = self._target_package_path(swift_host_triple)
208+
with shell.pushd(xctest.build_dir):
209+
shell.call([self.toolchain.cmake, '--install', '.', '--prefix', '/usr'],
210+
env={'DESTDIR': dest_dir})
211+
193212
def _build_target_package(self, swift_host_triple, has_pthread,
194213
stdlib_build_path, llvm_runtime_libs_build_path,
195214
wasi_sysroot):
@@ -215,6 +234,7 @@ def _build_target_package(self, swift_host_triple, has_pthread,
215234
self._build_foundation(swift_host_triple, has_pthread, wasi_sysroot)
216235
# Build swift-testing
217236
self._build_swift_testing(swift_host_triple, has_pthread, wasi_sysroot)
237+
self._build_xctest(swift_host_triple, has_pthread, wasi_sysroot)
218238

219239
return dest_dir
220240

0 commit comments

Comments
 (0)