@@ -1483,19 +1483,13 @@ elif (run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'openbsd', 'windows-
1483
1483
config .import_libdispatch = ('-I %s -I %s -L %s'
1484
1484
% (libdispatch_source_dir , libdispatch_swift_module_dir , libdispatch_artifact_dir ))
1485
1485
1486
- libdispatch_static_artifact_dir = config .libdispatch_static_build_path
1487
- libdispatch_swift_static_module_dir = make_path (libdispatch_static_artifact_dir , 'src' , 'swift' , 'swift' )
1486
+ libdispatch_static_artifact_dir = os .path .join (config .libdispatch_static_build_path , 'lib' )
1488
1487
libdispatch_static_artifacts = [
1489
- make_path (libdispatch_static_artifact_dir , 'src' , 'libdispatch.a' ),
1490
- make_path (libdispatch_static_artifact_dir , 'src' , 'swift' , 'libswiftDispatch.a' ),
1491
- make_path (libdispatch_swift_static_module_dir , 'Dispatch.swiftmodule' )]
1488
+ make_path (libdispatch_static_artifact_dir , 'libdispatch.a' ),
1489
+ make_path (libdispatch_static_artifact_dir , 'libBlocksRuntime.a' )]
1492
1490
if (all (os .path .exists (p ) for p in libdispatch_static_artifacts )):
1493
1491
config .available_features .add ('libdispatch_static' )
1494
- config .import_libdispatch_static = ('-I %s -I %s -L %s -L %s -L %s'
1495
- % (libdispatch_source_dir , libdispatch_swift_static_module_dir ,
1496
- make_path (libdispatch_static_artifact_dir , 'src' ),
1497
- make_path (libdispatch_static_artifact_dir , 'src' , 'BlocksRuntime' ),
1498
- make_path (libdispatch_static_artifact_dir , 'src' , 'swift' )))
1492
+ config .import_libdispatch_static = '-L %s' % libdispatch_static_artifact_dir
1499
1493
1500
1494
config .target_build_swift = (
1501
1495
'%s -target %s -toolchain-stdlib-rpath %s %s %s %s %s'
@@ -2519,6 +2513,10 @@ run_filecheck = '%s %s --allow-unused-prefixes --sanitize BUILD_DIR=%s --sanitiz
2519
2513
config .substitutions .append (('%FileCheck' , run_filecheck ))
2520
2514
config .substitutions .append (('%raw-FileCheck' , shell_quote (config .filecheck )))
2521
2515
config .substitutions .append (('%import-libdispatch' , getattr (config , 'import_libdispatch' , '' )))
2516
+ # WARNING: the order of components in a substitution name has to be different from the previous one, as lit does
2517
+ # a pure string substitution without understanding that these components are grouped together. That is, the following
2518
+ # subsitution name can't be `%import-libdispatch-static`, otherwise the first two components will be substituted with
2519
+ # the value of `%import-libdispatch` substitution with `-static` string appended to it.
2522
2520
config .substitutions .append (('%import-static-libdispatch' , getattr (config , 'import_libdispatch_static' , '' )))
2523
2521
2524
2522
# Disable COW sanity checks in the swift runtime by default.
0 commit comments