@@ -114,7 +114,7 @@ def build(args):
114
114
build_dir = os .path .abspath (args .build_dir )
115
115
foundation_build_dir = os .path .abspath (args .foundation_build_dir )
116
116
core_foundation_build_dir = GenericUnixStrategy .core_foundation_build_dir (
117
- foundation_build_dir )
117
+ foundation_build_dir , args . foundation_install_prefix )
118
118
if args .libdispatch_build_dir :
119
119
libdispatch_build_dir = os .path .abspath (args .libdispatch_build_dir )
120
120
if args .libdispatch_src_dir :
@@ -201,7 +201,7 @@ def test(args):
201
201
tests_path = os .path .join (SOURCE_DIR , "Tests" , "Functional" )
202
202
foundation_build_dir = os .path .abspath (args .foundation_build_dir )
203
203
core_foundation_build_dir = GenericUnixStrategy .core_foundation_build_dir (
204
- foundation_build_dir )
204
+ foundation_build_dir , args . foundation_install_prefix )
205
205
206
206
run ('SWIFT_EXEC={swiftc} '
207
207
'BUILT_PRODUCTS_DIR={built_products_dir} '
@@ -246,7 +246,7 @@ def install(args):
246
246
os .path .join (module_install_path , xctest_swiftdoc )))
247
247
248
248
@staticmethod
249
- def core_foundation_build_dir (foundation_build_dir ):
249
+ def core_foundation_build_dir (foundation_build_dir , foundation_install_prefix ):
250
250
"""
251
251
Given the path to a swift-corelibs-foundation built product directory,
252
252
return the path to CoreFoundation built products.
@@ -257,7 +257,8 @@ def core_foundation_build_dir(foundation_build_dir):
257
257
include this extra path when linking the installed Swift's
258
258
'usr/lib/swift/linux/libFoundation.so'.
259
259
"""
260
- return os .path .join (foundation_build_dir , 'usr' , 'lib' , 'swift' )
260
+ return os .path .join (foundation_build_dir ,
261
+ foundation_install_prefix .strip ("/" ), 'lib' , 'swift' )
261
262
262
263
263
264
def main (args = sys .argv [1 :]):
@@ -320,13 +321,20 @@ def main(args=sys.argv[1:]):
320
321
build_parser .add_argument (
321
322
"--build-dir" ,
322
323
help = "Path to the output build directory. If not specified, a "
323
- "temporary directory is used" ,
324
+ "temporary directory is used. " ,
324
325
default = tempfile .mkdtemp ())
325
326
build_parser .add_argument (
326
327
"--foundation-build-dir" ,
327
328
help = "Path to swift-corelibs-foundation build products, which "
328
329
"the built XCTest.so will be linked against." ,
329
330
required = strategy .requires_foundation_build_dir ())
331
+ build_parser .add_argument (
332
+ "--foundation-install-prefix" ,
333
+ help = "Path to the installation location for swift-corelibs-foundation "
334
+ "build products ('%(default)s' by default); CoreFoundation "
335
+ "dependencies are expected to be found under "
336
+ "FOUNDATION_BUILD_DIR/FOUNDATION_INSTALL_PREFIX." ,
337
+ default = "/usr" )
330
338
build_parser .add_argument (
331
339
"--libdispatch-build-dir" ,
332
340
help = "Path to swift-corelibs-libdispatch build products, which "
@@ -394,6 +402,13 @@ def main(args=sys.argv[1:]):
394
402
help = "Path to swift-corelibs-foundation build products, which the "
395
403
"tests will be linked against." ,
396
404
required = strategy .requires_foundation_build_dir ())
405
+ test_parser .add_argument (
406
+ "--foundation-install-prefix" ,
407
+ help = "Path to the installation location for swift-corelibs-foundation "
408
+ "build products ('%(default)s' by default); CoreFoundation "
409
+ "dependencies are expected to be found under "
410
+ "FOUNDATION_BUILD_DIR/FOUNDATION_INSTALL_PREFIX." ,
411
+ default = "/usr" )
397
412
398
413
install_parser = subparsers .add_parser (
399
414
"install" ,
0 commit comments