OS
Triple.swift:1087enum OS
enum OS
import Basics
@dynamicMemberLookup struct Triple
Helper for working with target triples.
case ananas
case cloudABI
case darwin
case dragonFly
case freeBSD
case fuchsia
case ios
case kfreebsd
case linux
case lv2
case macosx
case netbsd
case openbsd
case solaris
case win32
case haiku
case minix
case rtems
case nacl
case cnk
case aix
case cuda
case nvcl
case amdhsa
case ps4
case elfiamcu
case tvos
case watchos
case mesa3d
case contiki
case amdpal
case hermitcore
case hurd
case wasi
case emscripten
case noneOS
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 Arch
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 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 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 isAIX: Bool { get }
var isDarwin: Bool { get }
isOSDarwin - Is this a “Darwin” OS (OS X, iOS, or watchOS).
var isMacOSX: Bool { get }
isMacOSX - Is this a Mac OS X triple. For legacy reasons, we support both “darwin” and “osx” as OS X triples.
var isTvOS: Bool { get }
Is this an Apple tvOS triple.
var isWatchOS: Bool { get }
Is this an Apple watchOS triple.
var isWindows: Bool { get }
var isiOS: Bool { get }
Is this an iOS triple. Note: This identifies tvOS as a variant of iOS. If that ever changes, i.e., if the two operating systems diverge or their version numbers get out of sync, that will need to be changed. watchOS has completely different version numbers so it is not included.
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)