Skip to content

Commit cf60251

Browse files
committed
Teach spm about armv7em and os none
- Adds preliminary knowledge of armv7em and no os environments to spm. Future diffs will be required to fully support these triples. This change allows a armv7em-apple-none-macho build via a destination v3 bundle to make it further through spm.
1 parent 03c7311 commit cf60251

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

Sources/Basics/Triple.swift

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ public struct Triple: Encodable, Equatable, Sendable {
4848
case aarch64
4949
case amd64
5050
case armv7
51+
case armv7em
5152
case armv6
5253
case armv5
5354
case arm
@@ -73,6 +74,8 @@ public struct Triple: Encodable, Equatable, Sendable {
7374
case windows
7475
case wasi
7576
case openbsd
77+
// 'OS' suffix purely to avoid name clash with Optional.none
78+
case noneOS = "none"
7679
}
7780

7881
public enum ABI: Encodable, Equatable, RawRepresentable, Sendable {
@@ -259,6 +262,11 @@ extension Triple {
259262
return ".dll"
260263
case .wasi:
261264
return ".wasm"
265+
case .noneOS:
266+
// Better as dynamic error or "fatalError", but it is a larger
267+
// undertaking to teach spm that dylibs are not available on some
268+
// platforms.
269+
return ".os-none-dynamic-library"
262270
}
263271
}
264272

@@ -272,6 +280,8 @@ extension Triple {
272280
return ".wasm"
273281
case .windows:
274282
return ".exe"
283+
case .noneOS:
284+
return ""
275285
}
276286
}
277287

Sources/SPMBuildCore/BinaryTarget+Extensions.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ extension Triple.OS {
9797
/// Returns a representation of the receiver that can be compared with platform strings declared in an XCFramework.
9898
fileprivate var asXCFrameworkPlatformString: String? {
9999
switch self {
100-
case .darwin, .linux, .wasi, .windows, .openbsd:
100+
case .darwin, .linux, .wasi, .windows, .openbsd, .noneOS:
101101
return nil // XCFrameworks do not support any of these platforms today.
102102
case .macOS:
103103
return "macos"

0 commit comments

Comments
 (0)