@@ -42,7 +42,7 @@ logging.basicConfig(
4242    ]),
4343    level = logging .INFO ,
4444)
45- g_macos_deployment_target  =  '12 .0' 
45+ g_macos_deployment_target  =  '14 .0' 
4646
4747g_shared_lib_prefix  =  "lib" 
4848if  platform .system () ==  'Darwin' :
@@ -638,6 +638,7 @@ def build_with_cmake(args, cmake_args, ninja_args, source_path, build_dir, cmake
638638            "-DCMAKE_BUILD_TYPE:=Debug" ,
639639            "-DCMAKE_Swift_FLAGS='%s'"  %  swift_flags ,
640640            "-DCMAKE_Swift_COMPILER:=%s"  %  (args .swiftc_path ),
641+             "-DCMAKE_Swift_COMPILER_TARGET={}" .format ((get_build_target (args ) +  g_macos_deployment_target ) if  platform .system () ==  'Darwin'  else  get_build_target (args )),
641642            "-DCMAKE_C_COMPILER:=%s"  %  (args .clang_path ),
642643            "-DCMAKE_AR:PATH=%s"  %  (args .ar_path ),
643644            "-DCMAKE_RANLIB:PATH=%s"  %  (args .ranlib_path ),
@@ -726,6 +727,10 @@ def build_swiftpm_with_cmake(args):
726727    """Builds SwiftPM using CMake.""" 
727728    logging .info ("Building SwiftPM (with CMake)" )
728729
730+     module_triple  =  get_build_target (args )
731+     if  platform .system () ==  'Darwin' :
732+         module_triple  =  module_triple .replace ('macosx' , 'macos' )
733+ 
729734    cmake_flags  =  [
730735        get_llbuild_cmake_arg (args ),
731736        "-DTSC_DIR="                +  os .path .join (args .build_dirs ["tsc" ],                   "cmake/modules" ),
@@ -738,6 +743,7 @@ def build_swiftpm_with_cmake(args):
738743        "-DSwiftCertificates_DIR="  +  os .path .join (args .build_dirs ["swift-certificates" ],    "cmake/modules" ),
739744        "-DSwiftBuild_DIR="         +  os .path .join (args .build_dirs ["swift-build" ],           "cmake/modules" ),
740745        "-DSWIFTPM_PATH_TO_SWIFT_SYNTAX_SOURCE="  +  args .source_dirs ["swift-syntax" ],
746+         "-DSwiftPMRuntime_MODULE_TRIPLE={}" .format (module_triple ),
741747    ]
742748
743749    if  platform .system () ==  'Darwin' :
@@ -746,14 +752,14 @@ def build_swiftpm_with_cmake(args):
746752
747753    build_with_cmake (args , cmake_flags , ["swift-bootstrap" , "PackageDescription" , "PackagePlugin" , "CompilerPluginSupport" ], args .project_root , args .bootstrap_dir )
748754
749-     triple  =  get_build_target (args )
750- 
751755    mkdir_p (os .path .join (args .bootstrap_dir , "pm" , "ManifestAPI" ))
752-     shutil .copy2 (os .path .join (args .bootstrap_dir , "Sources" , "Runtimes" , "PackageDescription" , "PackageDescription.swiftmodule" , "%s.swiftmodule"  %  triple ),
756+     shutil .copy2 (os .path .join (args .bootstrap_dir , "Sources" , "Runtimes" , "PackageDescription" , "PackageDescription.swiftmodule" , "%s.swiftmodule"  %  module_triple ),
753757                 os .path .join (args .bootstrap_dir , "pm" , "ManifestAPI" , "PackageDescription.swiftmodule" ))
758+     shutil .copy2 (os .path .join (args .bootstrap_dir , "Sources" , "Runtimes" , "CompilerPluginSupport" , "CompilerPluginSupport.swiftmodule" , "%s.swiftmodule"  %  module_triple ),
759+                  os .path .join (args .bootstrap_dir , "pm" , "ManifestAPI" , "CompilerPluginSupport.swiftmodule" ))
754760
755761    mkdir_p (os .path .join (args .bootstrap_dir , "pm" , "PluginAPI" ))
756-     shutil .copy2 (os .path .join (args .bootstrap_dir , "Sources" , "Runtimes" , "PackagePlugin" , "PackagePlugin.swiftmodule" , "%s.swiftmodule"  %  triple ),
762+     shutil .copy2 (os .path .join (args .bootstrap_dir , "Sources" , "Runtimes" , "PackagePlugin" , "PackagePlugin.swiftmodule" , "%s.swiftmodule"  %  module_triple ),
757763                 os .path .join (args .bootstrap_dir , "pm" , "PluginAPI" , "PackagePlugin.swiftmodule" ))
758764
759765    if  args .llbuild_link_framework :
0 commit comments