We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2cfcdf4 commit c2556ebCopy full SHA for c2556eb
include/swift/Basic/Platform.h
@@ -46,6 +46,10 @@ namespace swift {
46
/// Return true if the given triple represents any simulator.
47
bool tripleIsAnySimulator(const llvm::Triple &triple);
48
49
+ /// Returns true if the given triple represents an OS that ships with ABI-stable
50
+ /// swift libraries (eg. in /usr/lib/swift).
51
+ bool tripleHasSwiftInTheOS(const llvm::Triple &triple);
52
+
53
/// Returns the platform name for a given target triple.
54
///
55
/// For example, the iOS simulator has the name "iphonesimulator", while real
lib/Basic/Platform.cpp
@@ -54,6 +54,25 @@ bool swift::tripleIsAnySimulator(const llvm::Triple &triple) {
tripleIsAppleTVSimulator(triple);
}
56
57
58
+bool swift::tripleHasSwiftInTheOS(const llvm::Triple &triple) {
59
+ unsigned major, minor, revision;
60
+ if (triple.isMacOSX()) {
61
+ triple.getMacOSXVersion(major, minor, revision);
62
+ return llvm::VersionTuple(major, minor, revision) >=
63
+ llvm::VersionTuple(10, 14, 4);
64
+ } else if (triple.isiOS()) {
65
+ triple.getiOSVersion(major, minor, revision);
66
67
+ llvm::VersionTuple(12, 2);
68
+ } else if (triple.isWatchOS()) {
69
+ triple.getOSVersion(major, minor, revision);
70
71
+ llvm::VersionTuple(5, 2);
72
+ }
73
+ return false;
74
+}
75
76
DarwinPlatformKind swift::getDarwinPlatformKind(const llvm::Triple &triple) {
77
if (triple.isiOS()) {
78
if (triple.isTvOS()) {
0 commit comments