File tree Expand file tree Collapse file tree 5 files changed +9
-3
lines changed
swift-tools-support-core/Sources/TSCUtility Expand file tree Collapse file tree 5 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ See http://swift.org/CONTRIBUTORS.txt for Swift project authors
9
9
*/
10
10
11
11
import TSCBasic
12
+ import TSCUtility
12
13
import PackageModel
13
14
import SPMBuildCore
14
15
import Foundation
Original file line number Diff line number Diff line change @@ -592,6 +592,7 @@ public final class ManifestLoader: ManifestLoaderProtocol {
592
592
}
593
593
}
594
594
595
+ private static var _hostTriple : Triple ?
595
596
private static var _packageDescriptionMinimumDeploymentTarget : String ?
596
597
597
598
/// Parse the manifest at the given path to JSON.
@@ -660,11 +661,15 @@ public final class ManifestLoader: ManifestLoaderProtocol {
660
661
661
662
// Use the same minimum deployment target as the PackageDescription library (with a fallback of 10.15).
662
663
#if os(macOS)
664
+ if Self . _hostTriple == nil {
665
+ Self . _hostTriple = Triple . getHostTriple ( usingSwiftCompiler: resources. swiftCompiler. pathString)
666
+ }
667
+ let triple = Self . _hostTriple!
663
668
if Self . _packageDescriptionMinimumDeploymentTarget == nil {
664
669
Self . _packageDescriptionMinimumDeploymentTarget = ( try MinimumDeploymentTarget . computeMinimumDeploymentTarget ( of: macOSPackageDescriptionPath) ) ? . versionString ?? " 10.15 "
665
670
}
666
671
let version = Self . _packageDescriptionMinimumDeploymentTarget!
667
- cmd += [ " -target " , " x86_64-apple-macosx \( version) " ]
672
+ cmd += [ " -target " , " \( triple ) \( version) " ]
668
673
#endif
669
674
670
675
cmd += compilerFlags
Original file line number Diff line number Diff line change @@ -11,8 +11,7 @@ add_library(SPMBuildCore
11
11
BuildSystem.swift
12
12
BuiltTestProduct.swift
13
13
Sanitizers.swift
14
- Toolchain.swift
15
- Triple.swift )
14
+ Toolchain.swift )
16
15
# NOTE(compnerd) workaround for CMake not setting up include flags yet
17
16
set_target_properties (SPMBuildCore PROPERTIES
18
17
INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_Swift_MODULE_DIRECTORY} )
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ add_library(TSCUtility
32
32
SimplePersistence.swift
33
33
StringExtensions.swift
34
34
StringMangling.swift
35
+ Triple.swift
35
36
URL.swift
36
37
Verbosity.swift
37
38
Version .swift
File renamed without changes.
You can’t perform that action at this time.
0 commit comments