@@ -174,6 +174,7 @@ def parse_global_args(args):
174174 args .swift_argument_parser_source_dir = os .path .join (args .project_root , ".." , "swift-argument-parser" )
175175 args .swift_driver_source_dir = os .path .join (args .project_root , ".." , "swift-driver" )
176176 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" )
177178 args .source_root = os .path .join (args .project_root , "Sources" )
178179
179180 if platform .system () == 'Darwin' :
@@ -322,6 +323,7 @@ def build(args):
322323 build_swift_argument_parser (args )
323324 build_swift_driver (args )
324325 build_swift_crypto (args )
326+ build_swift_collections (args )
325327 build_swiftpm_with_cmake (args )
326328
327329 build_swiftpm_with_swiftpm (args ,integrated_swift_driver = False )
@@ -561,7 +563,7 @@ def build_swift_driver(args):
561563 cmake_flags .append ("-DCMAKE_OSX_DEPLOYMENT_TARGET=%s" % g_macos_deployment_target )
562564
563565 build_with_cmake (args , cmake_flags , args .swift_driver_source_dir , args .swift_driver_build_dir )
564-
566+
565567def build_swift_crypto (args ):
566568 note ("Building SwiftCrypto" )
567569 args .swift_crypto_build_dir = os .path .join (args .target_dir , "swift-crypto" )
@@ -573,6 +575,17 @@ def build_swift_crypto(args):
573575
574576 build_with_cmake (args , cmake_flags , args .swift_crypto_source_dir , args .swift_crypto_build_dir )
575577
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+
576589def add_rpath_for_cmake_build (args , rpath ):
577590 "Adds the given rpath to the CMake-built swift-build"
578591 swift_build = os .path .join (args .bootstrap_dir , "bin/swift-build" )
@@ -591,6 +604,7 @@ def build_swiftpm_with_cmake(args):
591604 "-DArgumentParser_DIR=" + os .path .join (args .swift_argument_parser_build_dir , "cmake/modules" ),
592605 "-DSwiftDriver_DIR=" + os .path .join (args .swift_driver_build_dir , "cmake/modules" ),
593606 "-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" ),
594608 ]
595609
596610 if platform .system () == 'Darwin' :
@@ -607,6 +621,7 @@ def build_swiftpm_with_cmake(args):
607621 add_rpath_for_cmake_build (args , os .path .join (args .swift_argument_parser_build_dir , "lib" ))
608622 add_rpath_for_cmake_build (args , os .path .join (args .swift_driver_build_dir , "lib" ))
609623 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" ))
610625
611626def build_swiftpm_with_swiftpm (args , integrated_swift_driver ):
612627 """Builds SwiftPM using the version of SwiftPM built with CMake."""
@@ -705,6 +720,7 @@ def get_swiftpm_env_cmd(args):
705720 os .path .join (args .swift_argument_parser_build_dir , "lib" ),
706721 os .path .join (args .swift_driver_build_dir , "lib" ),
707722 os .path .join (args .swift_crypto_build_dir , "lib" ),
723+ os .path .join (args .swift_collections_build_dir , "lib" ),
708724 ] + args .target_info ["paths" ]["runtimeLibraryPaths" ])
709725
710726 if platform .system () == 'Darwin' :
0 commit comments