@@ -59,6 +59,7 @@ def call_without_sleeping(command, env=None, dry_run=False, echo=False):
5959class Builder (object ):
6060 def __init__ (self , toolchain , args ):
6161 self .toolchain = toolchain
62+ self .ninja_path = args .ninja_path
6263 self .build_release = args .release
6364 self .enable_assertions = not args .no_assertions
6465 self .lto_type = args .lto_type
@@ -81,6 +82,7 @@ class Builder(object):
8182
8283 def configure (self , enable_debuginfo , instrumentation = None , profile_data = None ):
8384 cmake_args = [self .toolchain .cmake , '-G' , 'Ninja' ]
85+ cmake_args += ['-DCMAKE_MAKE_PROGRAM=' + self .ninja_path ]
8486 if isMac :
8587 cmake_args += ['-DCMAKE_OSX_DEPLOYMENT_TARGET=10.12' , '-DSWIFT_DARWIN_DEPLOYMENT_VERSION_OSX=10.12' ]
8688 else :
@@ -186,10 +188,13 @@ def main():
186188 store_int = optbuilder .actions .store_int
187189 store_path = optbuilder .actions .store_path
188190
191+ toolchain = host_toolchain (xcrun_toolchain = 'default' )
192+
189193 default_profile_input = os .path .join (SWIFT_SOURCE_ROOT , "swift" , "utils" , "parser-lib" , "profile-input.swift" )
190194 default_jobs = multiprocessing .cpu_count ()
191195 default_build_dir = os .path .join (SWIFT_BUILD_ROOT , 'parser-lib' )
192196 default_install_prefix = defaults .DARWIN_INSTALL_PREFIX if isMac else UNIX_INSTALL_PREFIX
197+ default_ninja = toolchain .ninja
193198
194199 option ('--release' , store_true ,
195200 help = 'build in release mode' )
@@ -231,11 +236,13 @@ def main():
231236 help = 'the install prefix to use (default = %s)' % default_install_prefix )
232237 option ('--version' , store ,
233238 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 )
234242
235243 parser = optbuilder .build ()
236244 args = parser .parse_args ()
237245
238- toolchain = host_toolchain (xcrun_toolchain = 'default' )
239246 builder = Builder (toolchain , args )
240247 builder .run ()
241248 return 0
0 commit comments