@@ -59,6 +59,7 @@ def call_without_sleeping(command, env=None, dry_run=False, echo=False):
59
59
class Builder (object ):
60
60
def __init__ (self , toolchain , args ):
61
61
self .toolchain = toolchain
62
+ self .ninja_path = args .ninja_path
62
63
self .build_release = args .release
63
64
self .enable_assertions = not args .no_assertions
64
65
self .lto_type = args .lto_type
@@ -81,6 +82,7 @@ class Builder(object):
81
82
82
83
def configure (self , enable_debuginfo , instrumentation = None , profile_data = None ):
83
84
cmake_args = [self .toolchain .cmake , '-G' , 'Ninja' ]
85
+ cmake_args += ['-DCMAKE_MAKE_PROGRAM=' + self .ninja_path ]
84
86
if isMac :
85
87
cmake_args += ['-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12' , '-DSWIFT_DARWIN_DEPLOYMENT_VERSION_OSX=10.12' ]
86
88
else :
@@ -186,10 +188,13 @@ def main():
186
188
store_int = optbuilder .actions .store_int
187
189
store_path = optbuilder .actions .store_path
188
190
191
+ toolchain = host_toolchain (xcrun_toolchain = 'default' )
192
+
189
193
default_profile_input = os .path .join (SWIFT_SOURCE_ROOT , "swift" , "utils" , "parser-lib" , "profile-input.swift" )
190
194
default_jobs = multiprocessing .cpu_count ()
191
195
default_build_dir = os .path .join (SWIFT_BUILD_ROOT , 'parser-lib' )
192
196
default_install_prefix = defaults .DARWIN_INSTALL_PREFIX if isMac else UNIX_INSTALL_PREFIX
197
+ default_ninja = toolchain .ninja
193
198
194
199
option ('--release' , store_true ,
195
200
help = 'build in release mode' )
@@ -231,11 +236,13 @@ def main():
231
236
help = 'the install prefix to use (default = %s)' % default_install_prefix )
232
237
option ('--version' , store ,
233
238
help = 'version string to use for the parser library' )
239
+ option ('--ninja-path' , store_path ,
240
+ default = default_ninja ,
241
+ help = 'the path to ninja (default = %s)' % default_ninja )
234
242
235
243
parser = optbuilder .build ()
236
244
args = parser .parse_args ()
237
245
238
- toolchain = host_toolchain (xcrun_toolchain = 'default' )
239
246
builder = Builder (toolchain , args )
240
247
builder .run ()
241
248
return 0
0 commit comments