@@ -115,6 +115,10 @@ def build(args):
115
115
foundation_build_dir = os .path .abspath (args .foundation_build_dir )
116
116
core_foundation_build_dir = GenericUnixStrategy .core_foundation_build_dir (
117
117
foundation_build_dir )
118
+ if args .libdispatch_build_dir :
119
+ libdispatch_build_dir = os .path .abspath (args .libdispatch_build_dir )
120
+ if args .libdispatch_src_dir :
121
+ libdispatch_src_dir = os .path .abspath (args .libdispatch_src_dir )
118
122
119
123
_mkdirp (build_dir )
120
124
@@ -128,17 +132,26 @@ def build(args):
128
132
129
133
# Not incremental..
130
134
# Build library
131
- run ("{swiftc} -c {style_options} -emit-object -emit-module "
135
+ if args .libdispatch_build_dir and args .libdispatch_src_dir :
136
+ libdispatch_args = "-I {libdispatch_build_dir}/src -I {libdispatch_src_dir} " .format (
137
+ libdispatch_build_dir = libdispatch_build_dir ,
138
+ libdispatch_src_dir = libdispatch_src_dir )
139
+ else :
140
+ libdispatch_args = ""
141
+
142
+ run ("{swiftc} -Xcc -fblocks -c {style_options} -emit-object -emit-module "
132
143
"-module-name XCTest -module-link-name XCTest -parse-as-library "
133
144
"-emit-module-path {build_dir}/XCTest.swiftmodule "
134
145
"-force-single-frontend-invocation "
135
146
"-I {foundation_build_dir} -I {core_foundation_build_dir} "
147
+ "{libdispatch_args} "
136
148
"{source_paths} -o {build_dir}/XCTest.o" .format (
137
149
swiftc = swiftc ,
138
150
style_options = style_options ,
139
151
build_dir = build_dir ,
140
152
foundation_build_dir = foundation_build_dir ,
141
153
core_foundation_build_dir = core_foundation_build_dir ,
154
+ libdispatch_args = libdispatch_args ,
142
155
source_paths = " " .join (sourcePaths )))
143
156
run ("{swiftc} -emit-library {build_dir}/XCTest.o "
144
157
"-L {foundation_build_dir} -lswiftGlibc -lswiftCore -lFoundation -lm "
@@ -314,6 +327,14 @@ def main(args=sys.argv[1:]):
314
327
help = "Path to swift-corelibs-foundation build products, which "
315
328
"the built XCTest.so will be linked against." ,
316
329
required = strategy .requires_foundation_build_dir ())
330
+ build_parser .add_argument (
331
+ "--libdispatch-build-dir" ,
332
+ help = "Path to swift-corelibs-libdispatch build products, which "
333
+ "the built XCTest.so will be linked against." )
334
+ build_parser .add_argument (
335
+ "--libdispatch-src-dir" ,
336
+ help = "Path to swift-corelibs-libdispatch source tree, which "
337
+ "the built XCTest.so will be linked against." )
317
338
build_parser .add_argument ("--swift-build-dir" ,
318
339
help = "deprecated, do not use" )
319
340
build_parser .add_argument ("--arch" , help = "deprecated, do not use" )
0 commit comments