@@ -193,6 +193,26 @@ def _build_swift_testing(self, swift_host_triple, has_pthread, wasi_sysroot):
193
193
shell .call ([self .toolchain .cmake , '--install' , '.' , '--prefix' , '/usr' ],
194
194
env = {'DESTDIR' : dest_dir })
195
195
196
+ def _build_xctest (self , swift_host_triple , has_pthread , wasi_sysroot ):
197
+ xctest = CMakeProduct (
198
+ args = self .args ,
199
+ toolchain = self .toolchain ,
200
+ source_dir = os .path .join (
201
+ os .path .dirname (self .source_dir ), 'swift-corelibs-xctest' ),
202
+ build_dir = os .path .join (self .build_dir , 'xctest' , swift_host_triple ))
203
+ self ._append_platform_cmake_options (
204
+ xctest .cmake_options , swift_host_triple , has_pthread , wasi_sysroot ,
205
+ extra_swift_flags = [])
206
+ xctest .cmake_options .define ('BUILD_SHARED_LIBS' , 'FALSE' )
207
+
208
+ xctest .build_with_cmake ([], self .args .build_variant , [],
209
+ prefer_native_toolchain = True ,
210
+ ignore_extra_cmake_options = True )
211
+ dest_dir = self ._target_package_path (swift_host_triple )
212
+ with shell .pushd (xctest .build_dir ):
213
+ shell .call ([self .toolchain .cmake , '--install' , '.' , '--prefix' , '/usr' ],
214
+ env = {'DESTDIR' : dest_dir })
215
+
196
216
def _build_target_package (self , swift_host_triple , has_pthread ,
197
217
stdlib_build_path , llvm_runtime_libs_build_path ,
198
218
wasi_sysroot ):
@@ -218,6 +238,7 @@ def _build_target_package(self, swift_host_triple, has_pthread,
218
238
self ._build_foundation (swift_host_triple , has_pthread , wasi_sysroot )
219
239
# Build swift-testing
220
240
self ._build_swift_testing (swift_host_triple , has_pthread , wasi_sysroot )
241
+ self ._build_xctest (swift_host_triple , has_pthread , wasi_sysroot )
221
242
222
243
return dest_dir
223
244
0 commit comments