@@ -74,6 +74,7 @@ class Builder(object):
74
74
shell .call (command , env = env , dry_run = self .dry_run , echo = self .verbose )
75
75
76
76
def configure (self , enable_debuginfo , instrumentation = None , profile_data = None ):
77
+ environment = {}
77
78
cmake_args = [self .toolchain .cmake , "-G" , "Ninja" ]
78
79
cmake_args += ["-DCMAKE_MAKE_PROGRAM=" + self .ninja_path ]
79
80
@@ -90,6 +91,7 @@ class Builder(object):
90
91
"-DCMAKE_OSX_DEPLOYMENT_TARGET=" + deployment_version ,
91
92
"-DSWIFT_DARWIN_DEPLOYMENT_VERSION_OSX=" + deployment_version ,
92
93
]
94
+ environment ["SDKROOT" ] = "macosx"
93
95
94
96
elif self .host == "linux" :
95
97
host_triple = "%s-unknown-linux" % (self .arch )
@@ -252,7 +254,7 @@ class Builder(object):
252
254
"-DSWIFT_INCLUDE_TESTS=FALSE" ,
253
255
]
254
256
cmake_args += [os .path .join (SWIFT_SOURCE_ROOT , "llvm-project" , "llvm" )]
255
- self .call (cmake_args )
257
+ self .call (cmake_args , env = environment )
256
258
257
259
def build_target (self , build_dir , target , env = None ):
258
260
invocation = [self .toolchain .cmake , "--build" , build_dir ]
@@ -441,6 +443,7 @@ Example invocations:
441
443
help = "space-separated list of architectures to build for. (default = %s)"
442
444
% default_architectures ,
443
445
)
446
+ option ("--no-install" , store_true , help = "disable install step" )
444
447
option (
445
448
"--install-symroot" , store_path , help = "the path to install debug symbols into"
446
449
)
@@ -467,7 +470,7 @@ Example invocations:
467
470
parser = optbuilder .build ()
468
471
args = parser .parse_args ()
469
472
470
- if not args .install_destdir :
473
+ if not args .install_destdir and not args . no_install :
471
474
args .install_destdir = os .path .join (args .build_dir , "install" )
472
475
473
476
swift_src_path = os .path .join (SWIFT_SOURCE_ROOT , "swift" )
@@ -503,8 +506,9 @@ Example invocations:
503
506
arch = architectures .pop (0 )
504
507
tmpargs = copy .copy (args )
505
508
tmpargs .build_dir = os .path .join (objroot , arch , "obj" )
506
- tmpargs .install_destdir = os .path .join (objroot , arch , "dst" )
507
- tmpargs .install_prefix = "/"
509
+ if not args .no_install :
510
+ tmpargs .install_destdir = os .path .join (objroot , arch , "dst" )
511
+ tmpargs .install_prefix = "/"
508
512
509
513
native_build_dir = tmpargs .build_dir
510
514
dst_dirs .append (tmpargs .install_destdir )
@@ -544,8 +548,9 @@ Example invocations:
544
548
545
549
for arch in architectures :
546
550
args .build_dir = os .path .join (objroot , arch , "obj" )
547
- args .install_destdir = os .path .join (objroot , arch , "dst" )
548
- args .install_prefix = "/"
551
+ if not args .no_install :
552
+ args .install_destdir = os .path .join (objroot , arch , "dst" )
553
+ args .install_prefix = "/"
549
554
550
555
dst_dirs .append (args .install_destdir )
551
556
@@ -559,11 +564,12 @@ Example invocations:
559
564
)
560
565
builder .run ()
561
566
562
- lipo = os .path .join (SWIFT_SOURCE_ROOT , "swift" , "utils" , "recursive-lipo" )
563
- shell .call (
564
- [lipo , "-v" , "--destination" , os .path .join (dstroot , "./" + prefix )]
565
- + dst_dirs
566
- )
567
+ if not args .no_install :
568
+ lipo = os .path .join (SWIFT_SOURCE_ROOT , "swift" , "utils" , "recursive-lipo" )
569
+ shell .call (
570
+ [lipo , "-v" , "--destination" , os .path .join (dstroot , "./" + prefix )]
571
+ + dst_dirs
572
+ )
567
573
568
574
if args .install_symroot :
569
575
extract_symbols (dstroot , prefix , symroot , args .build_jobs )
0 commit comments