-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathtriplets.ts
More file actions
60 lines (49 loc) · 1.46 KB
/
triplets.ts
File metadata and controls
60 lines (49 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
/**
* https://developer.android.com/ndk/guides/other_build_systems
*/
export const ANDROID_TRIPLETS = [
"aarch64-linux-android",
"armv7a-linux-androideabi",
"i686-linux-android",
"x86_64-linux-android",
] as const;
export type AndroidTriplet = (typeof ANDROID_TRIPLETS)[number];
export const APPLE_TRIPLETS = [
"x86_64-apple-darwin",
"arm64-apple-darwin",
"arm64;x86_64-apple-darwin",
"arm64-apple-ios",
"x86_64-apple-ios-sim",
"arm64-apple-ios-sim",
"arm64;x86_64-apple-ios-sim",
"arm64-apple-tvos",
// "x86_64-apple-tvos",
"x86_64-apple-tvos-sim",
"arm64-apple-tvos-sim",
"arm64;x86_64-apple-tvos-sim",
"arm64-apple-visionos",
"x86_64-apple-visionos-sim",
"arm64-apple-visionos-sim",
"arm64;x86_64-apple-visionos-sim",
] as const;
export type AppleTriplet = (typeof APPLE_TRIPLETS)[number];
export const SUPPORTED_TRIPLETS = [
...APPLE_TRIPLETS,
...ANDROID_TRIPLETS,
] as const;
export type SupportedTriplet = (typeof SUPPORTED_TRIPLETS)[number];
export function isSupportedTriplet(
triplet: unknown,
): triplet is SupportedTriplet {
return (SUPPORTED_TRIPLETS as readonly unknown[]).includes(triplet);
}
export function isAndroidTriplet(
triplet: SupportedTriplet,
): triplet is AndroidTriplet {
return (ANDROID_TRIPLETS as readonly unknown[]).includes(triplet);
}
export function isAppleTriplet(
triplet: SupportedTriplet,
): triplet is AppleTriplet {
return (APPLE_TRIPLETS as readonly unknown[]).includes(triplet);
}