Skip to content

Commit ac962fc

Browse files
authored
Updated K/N targets in accordance with official recommendations (#2216)
Resolves #2210
1 parent abb8afc commit ac962fc

File tree

1 file changed

+26
-20
lines changed

1 file changed

+26
-20
lines changed

gradle/native-targets.gradle

+26-20
Original file line numberDiff line numberDiff line change
@@ -99,41 +99,47 @@ kotlin {
9999
if (project.ext.singleTargetMode) {
100100
fromPreset(project.ext.ideaPreset, 'native')
101101
} else {
102-
// Linux
102+
// According to https://kotlinlang.org/docs/native-target-support.html
103+
// Tier 1
103104
addTarget(presets.linuxX64)
104-
if (doesNotDependOnOkio(project)) {
105-
addTarget(presets.linuxArm32Hfp)
106-
addTarget(presets.linuxArm64)
107-
}
108-
109-
// Mac & iOS
110105
addTarget(presets.macosX64)
106+
addTarget(presets.macosArm64)
107+
addTarget(presets.iosSimulatorArm64)
108+
addTarget(presets.iosX64)
111109

112-
addTarget(presets.iosArm64)
110+
// Tier 2
113111
if (doesNotDependOnOkio(project)) {
114-
addTarget(presets.iosArm32)
112+
addTarget(presets.linuxArm64)
115113
}
116-
addTarget(presets.iosX64)
117-
118-
addTarget(presets.watchosX86)
114+
addTarget(presets.watchosSimulatorArm64)
119115
addTarget(presets.watchosX64)
120116
addTarget(presets.watchosArm32)
121117
addTarget(presets.watchosArm64)
122-
123-
addTarget(presets.tvosArm64)
118+
addTarget(presets.tvosSimulatorArm64)
124119
addTarget(presets.tvosX64)
120+
addTarget(presets.tvosArm64)
121+
addTarget(presets.iosArm64)
125122

126-
// Apple Silicon
127-
addTarget(presets.iosSimulatorArm64)
128-
addTarget(presets.watchosSimulatorArm64)
129-
addTarget(presets.tvosSimulatorArm64)
130-
addTarget(presets.macosArm64)
123+
// Tier 3
124+
if (doesNotDependOnOkio(project)) {
125+
addTarget(presets.androidNativeArm32)
126+
addTarget(presets.androidNativeArm64)
127+
addTarget(presets.androidNativeX86)
128+
addTarget(presets.androidNativeX64)
129+
addTarget(presets.watchosDeviceArm64)
130+
}
131131

132-
// Windows
133132
addTarget(presets.mingwX64)
133+
134+
// Deprecated, but were provided by kotlinx.serialization; can be removed only when K/N drops the target
135+
addTarget(presets.watchosX86)
136+
134137
if (doesNotDependOnOkio(project)) {
138+
addTarget(presets.iosArm32)
139+
addTarget(presets.linuxArm32Hfp)
135140
addTarget(presets.mingwX86)
136141
}
142+
137143
}
138144

139145
if (project.ext.nativeState == NativeState.HOST) {

0 commit comments

Comments
 (0)