@@ -96,6 +96,13 @@ kotlin {
96
96
97
97
targets {
98
98
if (project. ext. nativeState == NativeState . DISABLED ) return
99
+
100
+ String [] versionComponents = (~/ [.-]/ ). split(compilerVersion, 4 )
101
+ String [] versionComponents1920 = [" 1" , " 9" , " 20" ]
102
+ def isAtLeast1920 = Arrays . compare(versionComponents, versionComponents1920) { lhs , rhs ->
103
+ (lhs as int ) <=> (rhs as int )
104
+ } >= 0
105
+
99
106
if (project. ext. singleTargetMode) {
100
107
fromPreset(project. ext. ideaPreset, ' native' )
101
108
} else {
@@ -131,20 +138,22 @@ kotlin {
131
138
132
139
addTarget(presets. mingwX64)
133
140
134
- // Deprecated, but were provided by kotlinx.serialization; can be removed only when K/N drops the target
135
- addTarget(presets. watchosX86)
141
+ // Deprecated, but were provided by kotlinx.serialization; can be removed only in 1.9.20 release.
142
+ if (! isAtLeast1920) {
143
+ addTarget(presets. watchosX86)
136
144
137
- if (doesNotDependOnOkio(project)) {
138
- addTarget(presets. iosArm32)
139
- addTarget(presets. linuxArm32Hfp)
140
- addTarget(presets. mingwX86)
145
+ if (doesNotDependOnOkio(project)) {
146
+ addTarget(presets. iosArm32)
147
+ addTarget(presets. linuxArm32Hfp)
148
+ addTarget(presets. mingwX86)
149
+ }
141
150
}
142
151
143
152
}
144
153
145
154
if (project. ext. nativeState == NativeState . HOST ) {
146
155
// linux targets that can cross-compile on all three hosts
147
- def linuxCrossCompileTargets = [ linuxX64, linuxArm32Hfp, linuxArm64]
156
+ def linuxCrossCompileTargets = isAtLeast1920 ? [presets . linuxX64] : [presets . linuxX64, presets . linuxArm32Hfp, presets . linuxArm64]
148
157
if (getHostName() != " linux" ) {
149
158
disableCompilation(linuxCrossCompileTargets)
150
159
}
0 commit comments