@@ -1283,17 +1283,31 @@ elif (run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'openbsd', 'windows-
1283
1283
1284
1284
libdispatch_artifact_dir = config .libdispatch_build_path
1285
1285
libdispatch_swift_module_dir = make_path (libdispatch_artifact_dir , 'src' , 'swift' , 'swift' )
1286
+ libdispatch_source_dir = make_path (config .swift_src_root , os .pardir , 'swift-corelibs-libdispatch' )
1286
1287
libdispatch_artifacts = [
1287
1288
make_path (libdispatch_artifact_dir , 'libdispatch.so' ),
1288
1289
make_path (libdispatch_artifact_dir , 'libswiftDispatch.so' ),
1289
1290
make_path (libdispatch_swift_module_dir , 'Dispatch.swiftmodule' )]
1290
1291
if (all (os .path .exists (p ) for p in libdispatch_artifacts )):
1291
1292
config .available_features .add ('libdispatch' )
1292
1293
config .libdispatch_artifact_dir = libdispatch_artifact_dir
1293
- libdispatch_source_dir = make_path (config .swift_src_root , os .pardir , 'swift-corelibs-libdispatch' )
1294
1294
config .import_libdispatch = ('-I %s -I %s -L %s'
1295
1295
% (libdispatch_source_dir , libdispatch_swift_module_dir , libdispatch_artifact_dir ))
1296
1296
1297
+ libdispatch_static_artifact_dir = config .libdispatch_static_build_path
1298
+ libdispatch_swift_static_module_dir = make_path (libdispatch_static_artifact_dir , 'src' , 'swift' , 'swift' )
1299
+ libdispatch_static_artifacts = [
1300
+ make_path (libdispatch_static_artifact_dir , 'src' , 'libdispatch.a' ),
1301
+ make_path (libdispatch_static_artifact_dir , 'src' , 'swift' , 'libswiftDispatch.a' ),
1302
+ make_path (libdispatch_swift_static_module_dir , 'Dispatch.swiftmodule' )]
1303
+ if (all (os .path .exists (p ) for p in libdispatch_static_artifacts )):
1304
+ config .available_features .add ('libdispatch_static' )
1305
+ config .import_libdispatch_static = ('-I %s -I %s -L %s -L %s -L %s'
1306
+ % (libdispatch_source_dir , libdispatch_swift_static_module_dir ,
1307
+ make_path (libdispatch_static_artifact_dir , 'src' ),
1308
+ make_path (libdispatch_static_artifact_dir , 'src' , 'BlocksRuntime' ),
1309
+ make_path (libdispatch_static_artifact_dir , 'src' , 'swift' )))
1310
+
1297
1311
config .target_build_swift = (
1298
1312
'%s -target %s -toolchain-stdlib-rpath %s %s %s %s %s'
1299
1313
% (config .swiftc , config .variant_triple , resource_dir_opt , mcp_opt ,
@@ -2100,6 +2114,7 @@ run_filecheck = '%s %s --sanitize BUILD_DIR=%s --sanitize SOURCE_DIR=%s --use-fi
2100
2114
config .substitutions .append (('%FileCheck' , run_filecheck ))
2101
2115
config .substitutions .append (('%raw-FileCheck' , shell_quote (config .filecheck )))
2102
2116
config .substitutions .append (('%import-libdispatch' , getattr (config , 'import_libdispatch' , '' )))
2117
+ config .substitutions .append (('%import-static-libdispatch' , getattr (config , 'import_libdispatch_static' , '' )))
2103
2118
2104
2119
if config .lldb_build_root != "" :
2105
2120
lldb_python_path = get_lldb_python_path (config .lldb_build_root )
0 commit comments