@@ -1297,17 +1297,31 @@ elif (run_os in ['linux-gnu', 'linux-gnueabihf', 'freebsd', 'openbsd', 'windows-
1297
1297
1298
1298
libdispatch_artifact_dir = config .libdispatch_build_path
1299
1299
libdispatch_swift_module_dir = make_path (libdispatch_artifact_dir , 'src' , 'swift' , 'swift' )
1300
+ libdispatch_source_dir = make_path (config .swift_src_root , os .pardir , 'swift-corelibs-libdispatch' )
1300
1301
libdispatch_artifacts = [
1301
1302
make_path (libdispatch_artifact_dir , 'libdispatch.so' ),
1302
1303
make_path (libdispatch_artifact_dir , 'libswiftDispatch.so' ),
1303
1304
make_path (libdispatch_swift_module_dir , 'Dispatch.swiftmodule' )]
1304
1305
if (all (os .path .exists (p ) for p in libdispatch_artifacts )):
1305
1306
config .available_features .add ('libdispatch' )
1306
1307
config .libdispatch_artifact_dir = libdispatch_artifact_dir
1307
- libdispatch_source_dir = make_path (config .swift_src_root , os .pardir , 'swift-corelibs-libdispatch' )
1308
1308
config .import_libdispatch = ('-I %s -I %s -L %s'
1309
1309
% (libdispatch_source_dir , libdispatch_swift_module_dir , libdispatch_artifact_dir ))
1310
1310
1311
+ libdispatch_static_artifact_dir = config .libdispatch_static_build_path
1312
+ libdispatch_swift_static_module_dir = make_path (libdispatch_static_artifact_dir , 'src' , 'swift' , 'swift' )
1313
+ libdispatch_static_artifacts = [
1314
+ make_path (libdispatch_static_artifact_dir , 'src' , 'libdispatch.a' ),
1315
+ make_path (libdispatch_static_artifact_dir , 'src' , 'swift' , 'libswiftDispatch.a' ),
1316
+ make_path (libdispatch_swift_static_module_dir , 'Dispatch.swiftmodule' )]
1317
+ if (all (os .path .exists (p ) for p in libdispatch_static_artifacts )):
1318
+ config .available_features .add ('libdispatch_static' )
1319
+ config .import_libdispatch_static = ('-I %s -I %s -L %s -L %s -L %s'
1320
+ % (libdispatch_source_dir , libdispatch_swift_static_module_dir ,
1321
+ make_path (libdispatch_static_artifact_dir , 'src' ),
1322
+ make_path (libdispatch_static_artifact_dir , 'src' , 'BlocksRuntime' ),
1323
+ make_path (libdispatch_static_artifact_dir , 'src' , 'swift' )))
1324
+
1311
1325
config .target_build_swift = (
1312
1326
'%s -target %s -toolchain-stdlib-rpath %s %s %s %s %s'
1313
1327
% (config .swiftc , config .variant_triple , resource_dir_opt , mcp_opt ,
@@ -2163,6 +2177,7 @@ run_filecheck = '%s %s --sanitize BUILD_DIR=%s --sanitize SOURCE_DIR=%s --use-fi
2163
2177
config .substitutions .append (('%FileCheck' , run_filecheck ))
2164
2178
config .substitutions .append (('%raw-FileCheck' , shell_quote (config .filecheck )))
2165
2179
config .substitutions .append (('%import-libdispatch' , getattr (config , 'import_libdispatch' , '' )))
2180
+ config .substitutions .append (('%import-static-libdispatch' , getattr (config , 'import_libdispatch_static' , '' )))
2166
2181
2167
2182
# Disabe COW sanity checks in the swift runtime by default.
2168
2183
# (But it's required to set this environment variable to something)
0 commit comments