@@ -325,8 +325,8 @@ def clear_gyb_files_from_previous_run(sources_dir, destination_dir, verbose):
325
325
# Building SwiftSyntax
326
326
327
327
328
- def get_installed_dylib_name ():
329
- return "libSwiftSyntax.dylib"
328
+ def get_installed_dylib_names ():
329
+ return [ "libSwiftSyntax.dylib" , "libSwiftSyntaxParser.dylib" ]
330
330
331
331
332
332
def get_swiftpm_invocation (toolchain , action , build_dir , multiroot_data_file , release ):
@@ -608,23 +608,23 @@ def check_and_sync(file_path, install_path):
608
608
609
609
610
610
def install (build_dir , dylib_dir , swiftmodule_base_name , stdlib_rpath ):
611
- dylib_name = get_installed_dylib_name ()
611
+ for dylib_name in get_installed_dylib_names ():
612
612
613
- dylib_path = os .path .join (build_dir , dylib_name )
614
- module_path = os .path .join (build_dir , "SwiftSyntax.swiftmodule" )
615
- doc_path = os .path .join (build_dir , "SwiftSyntax.swiftdoc" )
613
+ dylib_path = os .path .join (build_dir , dylib_name )
614
+
615
+ # users should find the dylib as if it's a part of stdlib.
616
+ change_id_rpath (os .path .join ("@rpath" , dylib_name ), dylib_path )
616
617
617
- # users should find the dylib as if it's a part of stdlib.
618
- change_id_rpath (os .path .join ("@rpath" , dylib_name ), dylib_path )
619
-
620
- # we don't wanna hard-code the stdlib dylibs into rpath.
621
- delete_rpath (stdlib_rpath , dylib_path )
622
- check_and_sync (
623
- file_path = dylib_path , install_path = os .path .join (dylib_dir , dylib_name )
624
- )
618
+ # we don't wanna hard-code the stdlib dylibs into rpath.
619
+ delete_rpath (stdlib_rpath , dylib_path )
620
+ check_and_sync (
621
+ file_path = dylib_path , install_path = os .path .join (dylib_dir , dylib_name )
622
+ )
625
623
626
624
# Optionally install .swiftmodule
627
625
if swiftmodule_base_name :
626
+ module_path = os .path .join (build_dir , "SwiftSyntax.swiftmodule" )
627
+ doc_path = os .path .join (build_dir , "SwiftSyntax.swiftdoc" )
628
628
module_dest = swiftmodule_base_name + ".swiftmodule"
629
629
doc_dest = swiftmodule_base_name + ".swiftdoc"
630
630
check_and_sync (file_path = module_path , install_path = module_dest )
@@ -797,9 +797,9 @@ def main():
797
797
798
798
if args .install :
799
799
if not args .dylib_dir :
800
- fatal_error ("Must specify directory to install" )
800
+ fatal_error ("Must specify directory to install (--dylib-dir) " )
801
801
if not args .build_dir :
802
- fatal_error ("Must specify build directory to copy from" )
802
+ fatal_error ("Must specify build directory to copy from (--build-dir) " )
803
803
if args .release :
804
804
build_dir = os .path .join (args .build_dir , "release" )
805
805
else :
@@ -857,7 +857,10 @@ def main():
857
857
verbose = args .verbose ,
858
858
disable_sandbox = args .disable_sandbox ,
859
859
)
860
+ # Until rdar://53881101 is implemented, we cannot request a build of multiple
861
+ # targets simultaneously. For now, just build one product after the other.
860
862
builder .build ("SwiftSyntax" , module_group_path = GROUP_INFO_PATH )
863
+ builder .build ("SwiftSyntaxParser" , module_group_path = GROUP_INFO_PATH )
861
864
862
865
# Only build lit-test-helper if we are planning to run tests
863
866
if args .test :
0 commit comments