@@ -405,7 +405,12 @@ def build_using_cmake(args, toolchain_bin, build_dir, targets):
405
405
base_cmake_flags .append ('-DCMAKE_OSX_DEPLOYMENT_TARGET=%s' % macos_deployment_target )
406
406
407
407
# Target directory for build artifacts
408
- cmake_target_dir = os .path .join (build_dir , target )
408
+ # If building for a local compiler build, use the build directory directly
409
+ if args .local_compiler_build :
410
+ cmake_target_dir = build_dir
411
+ else :
412
+ cmake_target_dir = os .path .join (build_dir , target )
413
+
409
414
driver_dir = os .path .join (cmake_target_dir , args .configuration )
410
415
dependencies_dir = os .path .join (driver_dir , 'dependencies' )
411
416
@@ -426,7 +431,7 @@ def build_using_cmake(args, toolchain_bin, build_dir, targets):
426
431
base_cmake_flags , swift_flags )
427
432
428
433
def build_llbuild_using_cmake (args , target , swiftc_exec , build_dir , base_cmake_flags , swift_flags ):
429
- print ('Building llbuild for target: %s' % target )
434
+ print ('Building Swift Driver dependency: llbuild' )
430
435
llbuild_source_dir = os .path .join (os .path .dirname (args .package_path ), 'llbuild' )
431
436
llbuild_build_dir = os .path .join (build_dir , 'llbuild' )
432
437
llbuild_api_dir = os .path .join (llbuild_build_dir , '.cmake/api/v1/query' )
@@ -454,15 +459,15 @@ def build_llbuild_using_cmake(args, target, swiftc_exec, build_dir, base_cmake_f
454
459
llbuild_source_dir , llbuild_build_dir , 'products/all' )
455
460
456
461
def build_tsc_using_cmake (args , target , swiftc_exec , build_dir , base_cmake_flags , swift_flags ):
457
- print ('Building TSC for target: %s' % target )
462
+ print ('Building Swift Driver dependency: TSC' )
458
463
tsc_source_dir = os .path .join (os .path .dirname (args .package_path ), 'swift-tools-support-core' )
459
464
tsc_build_dir = os .path .join (build_dir , 'swift-tools-support-core' )
460
465
tsc_swift_flags = swift_flags [:]
461
466
cmake_build (args , swiftc_exec , base_cmake_flags , tsc_swift_flags ,
462
467
tsc_source_dir , tsc_build_dir )
463
468
464
469
def build_yams_using_cmake (args , target , swiftc_exec , build_dir , base_cmake_flags , swift_flags ):
465
- print ('Building Yams for target: %s' % target )
470
+ print ('Building Swift Driver dependency: Yams' )
466
471
yams_source_dir = os .path .join (os .path .dirname (args .package_path ), 'yams' )
467
472
yams_build_dir = os .path .join (build_dir , 'yams' )
468
473
yams_cmake_flags = base_cmake_flags + [
@@ -481,7 +486,7 @@ def build_yams_using_cmake(args, target, swiftc_exec, build_dir, base_cmake_flag
481
486
yams_source_dir , yams_build_dir )
482
487
483
488
def build_argument_parser_using_cmake (args , target , swiftc_exec , build_dir , base_cmake_flags , swift_flags ):
484
- print ('Building Argument Parser for target: %s' % target )
489
+ print ('Building Swift Driver dependency: Argument Parser' )
485
490
parser_source_dir = os .path .join (os .path .dirname (args .package_path ), 'swift-argument-parser' )
486
491
parser_build_dir = os .path .join (build_dir , 'swift-argument-parser' )
487
492
custom_flags = ['-DBUILD_TESTING=NO' , '-DBUILD_EXAMPLES=NO' ]
@@ -583,6 +588,7 @@ def add_common_args(parser):
583
588
parser .add_argument ('--configuration' , '-c' , default = 'debug' , help = 'build using configuration (release|debug)' )
584
589
parser .add_argument ('--no-local-deps' , action = 'store_true' , help = 'use normal remote dependencies when building' )
585
590
parser .add_argument ('--verbose' , '-v' , action = 'store_true' , help = 'enable verbose output' )
591
+ parser .add_argument ('--local_compiler_build' , action = 'store_true' , help = 'driver is being built for use with a local compiler build' )
586
592
587
593
subparsers = parser .add_subparsers (title = 'subcommands' , dest = 'action' , metavar = 'action' )
588
594
clean_parser = subparsers .add_parser ('clean' , help = 'clean the package' )
@@ -612,6 +618,9 @@ def add_common_args(parser):
612
618
if args .cross_compile_hosts and not all ('apple-macos' in target for target in args .cross_compile_hosts ):
613
619
error ('Cross-compilation is currently only supported for the Darwin platform.' )
614
620
621
+ if args .cross_compile_hosts and args .local_compiler_build :
622
+ error ('Cross-compilation is currently not supported for the local compiler installation' )
623
+
615
624
if args .dispatch_build_dir :
616
625
args .dispatch_build_dir = os .path .abspath (args .dispatch_build_dir )
617
626
0 commit comments