@@ -174,6 +174,7 @@ def parse_global_args(args):
174
174
args .swift_argument_parser_source_dir = os .path .join (args .project_root , ".." , "swift-argument-parser" )
175
175
args .swift_driver_source_dir = os .path .join (args .project_root , ".." , "swift-driver" )
176
176
args .swift_crypto_source_dir = os .path .join (args .project_root , ".." , "swift-crypto" )
177
+ args .swift_collections_source_dir = os .path .join (args .project_root , ".." , "swift-collections" )
177
178
args .source_root = os .path .join (args .project_root , "Sources" )
178
179
179
180
if platform .system () == 'Darwin' :
@@ -322,6 +323,7 @@ def build(args):
322
323
build_swift_argument_parser (args )
323
324
build_swift_driver (args )
324
325
build_swift_crypto (args )
326
+ build_swift_collections (args )
325
327
build_swiftpm_with_cmake (args )
326
328
327
329
build_swiftpm_with_swiftpm (args ,integrated_swift_driver = False )
@@ -561,7 +563,7 @@ def build_swift_driver(args):
561
563
cmake_flags .append ("-DCMAKE_OSX_DEPLOYMENT_TARGET=%s" % g_macos_deployment_target )
562
564
563
565
build_with_cmake (args , cmake_flags , args .swift_driver_source_dir , args .swift_driver_build_dir )
564
-
566
+
565
567
def build_swift_crypto (args ):
566
568
note ("Building SwiftCrypto" )
567
569
args .swift_crypto_build_dir = os .path .join (args .target_dir , "swift-crypto" )
@@ -573,6 +575,17 @@ def build_swift_crypto(args):
573
575
574
576
build_with_cmake (args , cmake_flags , args .swift_crypto_source_dir , args .swift_crypto_build_dir )
575
577
578
+ def build_swift_collections (args ):
579
+ note ("Building SwiftCollctions" )
580
+ args .swift_collections_build_dir = os .path .join (args .target_dir , "swift-collections" )
581
+
582
+ cmake_flags = []
583
+ if platform .system () == 'Darwin' :
584
+ cmake_flags .append ("-DCMAKE_C_FLAGS=-target %s%s" % (get_build_target (args ), g_macos_deployment_target ))
585
+ cmake_flags .append ("-DCMAKE_OSX_DEPLOYMENT_TARGET=%s" % g_macos_deployment_target )
586
+
587
+ build_with_cmake (args , cmake_flags , args .swift_collections_source_dir , args .swift_collections_build_dir )
588
+
576
589
def add_rpath_for_cmake_build (args , rpath ):
577
590
"Adds the given rpath to the CMake-built swift-build"
578
591
swift_build = os .path .join (args .bootstrap_dir , "bin/swift-build" )
@@ -591,6 +604,7 @@ def build_swiftpm_with_cmake(args):
591
604
"-DArgumentParser_DIR=" + os .path .join (args .swift_argument_parser_build_dir , "cmake/modules" ),
592
605
"-DSwiftDriver_DIR=" + os .path .join (args .swift_driver_build_dir , "cmake/modules" ),
593
606
"-DSwiftCrypto_DIR=" + os .path .join (args .swift_crypto_build_dir , "cmake/modules" ),
607
+ "-DSwiftCollections_DIR=" + os .path .join (args .swift_collections_build_dir , "cmake/modules" ),
594
608
]
595
609
596
610
if platform .system () == 'Darwin' :
@@ -607,6 +621,7 @@ def build_swiftpm_with_cmake(args):
607
621
add_rpath_for_cmake_build (args , os .path .join (args .swift_argument_parser_build_dir , "lib" ))
608
622
add_rpath_for_cmake_build (args , os .path .join (args .swift_driver_build_dir , "lib" ))
609
623
add_rpath_for_cmake_build (args , os .path .join (args .swift_crypto_build_dir , "lib" ))
624
+ add_rpath_for_cmake_build (args , os .path .join (args .swift_collections_build_dir , "lib" ))
610
625
611
626
def build_swiftpm_with_swiftpm (args , integrated_swift_driver ):
612
627
"""Builds SwiftPM using the version of SwiftPM built with CMake."""
@@ -705,6 +720,7 @@ def get_swiftpm_env_cmd(args):
705
720
os .path .join (args .swift_argument_parser_build_dir , "lib" ),
706
721
os .path .join (args .swift_driver_build_dir , "lib" ),
707
722
os .path .join (args .swift_crypto_build_dir , "lib" ),
723
+ os .path .join (args .swift_collections_build_dir , "lib" ),
708
724
] + args .target_info ["paths" ]["runtimeLibraryPaths" ])
709
725
710
726
if platform .system () == 'Darwin' :
0 commit comments