Arch
Triple.swift:429enum Arch
enum Arch
import Basics
@dynamicMemberLookup struct Triple
Helper for working with target triples.
case arm
ARM (little endian): arm, armv.*, xscale
case armeb
case aarch64
AArch64 (little endian): aarch64
case aarch64e
AArch64e (little endian): aarch64e
case aarch64_be
AArch64 (big endian): aarch64_be
case aarch64_32
case arc
ARC: Synopsis ARC
case avr
AVR: Atmel AVR microcontroller
case bpfel
eBPF or extended BPF or 64-bit BPF (little endian)
case bpfeb
eBPF or extended BPF or 64-bit BPF (big endian)
case hexagon
Hexagon: hexagon
case mips
MIPS: mips, mipsallegrex, mipsr6
case mipsel
MIPSEL: mipsel, mipsallegrexe, mipsr6el
case mips64
case mips64el
case msp430
case ppc
case ppc64
case ppc64le
case r600
case amdgcn
case riscv32
case riscv64
case sparc
case sparcv9
case sparcel
case systemz
case tce
case tcele
case thumb
case thumbeb
case x86
case x86_64
case xcore
case nvptx
case nvptx64
case le32
case le64
case amdil
case amdil64
case hsail
case hsail64
case spir
case spir64
case kalimba
case shave
case lanai
case wasm32
case wasm64
case renderscript32
case renderscript64
init(_ description: String) throws
init(_ string: String, normalizing: Bool = false)
init(from decoder: Decoder) throws
static let macOS: Triple
static func getHostTriple(usingSwiftCompiler swiftCompiler: AbsolutePath) throws -> Triple
Determine the versioned host triple using the Swift compiler.
var _iOSVersion: Version { get }
Parse the version number as with getOSVersion. This should only be called with IOS or generic triples.
var _isSimulatorEnvironment: Bool { get }
If this is a Darwin device platform, should it be inferred to be a device simulator?
var _macOSVersion: Version? { get }
Parse the version number as with getOSVersion and then translate generic “darwin” versions to the corresponding OS X versions. This may also be called with IOS triples but the OS X version number is just set to a constant 10.4.0 in that case.
var _watchOSVersion: Version { get }
Parse the version number as with getOSVersion. This should only be called with WatchOS or generic triples.
let arch: Arch?
The parsed arch.
var archName: String { get }
var darwinLinkerPlatformVersion: Version { get }
var darwinPlatform: DarwinPlatform? { get }
Returns the DarwinPlatform
for this triple, or nil
if it is a non-Darwin platform.
var description: String { get }
var dynamicLibraryExtension: String { get }
The file extension for dynamic libraries (eg. .dll
, .so
, or .dylib
)
var dynamicLibraryPrefix: String { get }
The file prefix for dynamic libraries
let environment: Environment?
The parsed Environment type.
var environmentName: String { get }
var executableExtension: String { get }
var isMacCatalyst: Bool { get }
var isWasm: Bool { get }
var nsbundleExtension: String { get }
The file extension for Foundation-style bundle.
let objectFormat: ObjectFormat?
The object format type.
let os: OS?
The parsed OS.
var osName: String { get }
Returns the name of the OS from the triple string.
var osNameUnversioned: String { get }
var osVersion: Version { get }
Parse the version number from the OS name component of the triple, if present.
var staticLibraryExtension: String { get }
The file extension for static libraries.
let subArch: SubArch?
The parsed subarchitecture.
let triple: String
The original triple string.
var tripleString: String { get }
let vendor: Vendor?
The parsed vendor.
var vendorName: String { get }
subscript(dynamicMember predicate: KeyPath<OS, Bool>) -> Bool { get }
Triple
proxies predicates from Triple.OS
, returning false
for an unknown OS.
static func == (lhs: Triple, rhs: Triple) -> Bool
func encode(to encoder: Encoder) throws
func isAndroid() -> Bool
func isApple() -> Bool
func isDarwin() -> Bool
func isLinux() -> Bool
func isOpenBSD() -> Bool
func isRuntimeCompatible(with triple: Triple) -> Bool
Returns true
if code compiled for triple
can run on self
value of Triple
.
func isWASI() -> Bool
func isWindows() -> Bool
func platformName(conflatingDarwin: Bool = false) -> String?
The platform name, i.e. the name clang uses to identify this target in its resource directory.
func supports(_ feature: FeatureAvailability) -> Bool
Checks whether the triple supports the specified feature, i.e., the feature has been introduced by the OS and version indicated by the triple.
func tripleString(forPlatformVersion version: String) -> String
Returns the triple string for the given platform version.
func version(for compatibilityPlatform: DarwinPlatform? = nil) -> Triple.Version
Returns the OS version equivalent for the given platform, converting and defaulting various representations.
enum Environment
struct FeatureAvailability
Represents the availability of a feature that is supported on some platforms and versions, but not all. For Darwin versions, the version numbers provided should be the version where the feature was added or the change was introduced, because all version checks are in the form of tripleVersion >= featureVersion
.
enum OS
enum ObjectFormat
enum SubArch
enum Vendor
struct Version
Represents a version that may be present in the target triple.
protocol CaseIterable
A type that provides a collection of all of its values.
protocol Decodable
A type that can decode itself from an external representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol RawRepresentable<RawValue>
A type that can be converted to and from an associated raw value.
init?(rawValue: String)
var is16Bit: Bool { get }
Whether or not this architecture has 16-bit pointers
var is32Bit: Bool { get }
Whether or not this architecture has 32-bit pointers
var is64Bit: Bool { get }
Whether or not this architecture has 64-bit pointers
init(from decoder: any Decoder) throws
Creates a new instance by decoding from the given decoder, when the type’s RawValue
is String
.
var hashValue: Int { get }
static func != (lhs: Self, rhs: Self) -> Bool
Returns a Boolean value indicating whether two values are not equal.
func hash(into hasher: inout Hasher)