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