From fffd99a400fbc935873391f3643e6f89dce4e627 Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Thu, 23 Feb 2023 20:30:27 +0100 Subject: [PATCH 1/2] Update K/N targets in accordance with official recommendations More tier 3 targets added Fixes #3601 Fixes #812 Fixes #855 --- README.md | 4 +-- gradle/compile-native-multiplatform.gradle | 36 +++++++++++++++------- 2 files changed, 27 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index ec5eeca3e5..0143564a49 100644 --- a/README.md +++ b/README.md @@ -187,8 +187,8 @@ Kotlin/JS version of `kotlinx.coroutines` is published as Kotlin/Native version of `kotlinx.coroutines` is published as [`kotlinx-coroutines-core-$platform`](https://mvnrepository.com/search?q=kotlinx-coroutines-core-) where `$platform` is -the target Kotlin/Native platform. [List of currently supported targets](https://github.com/Kotlin/kotlinx.coroutines/blob/master/gradle/compile-native-multiplatform.gradle#L16). - +the target Kotlin/Native platform. +Targets are provided in accordance with [official K/N target support](https://kotlinlang.org/docs/native-target-support.html). ## Building and Contributing See [Contributing Guidelines](CONTRIBUTING.md). diff --git a/gradle/compile-native-multiplatform.gradle b/gradle/compile-native-multiplatform.gradle index 1aeb8d2c54..3b2758854f 100644 --- a/gradle/compile-native-multiplatform.gradle +++ b/gradle/compile-native-multiplatform.gradle @@ -15,22 +15,36 @@ kotlin { } targets { + // According to https://kotlinlang.org/docs/native-target-support.html + // Tier 1 addTarget(presets.linuxX64) - addTarget(presets.iosArm64) - addTarget(presets.iosArm32) - addTarget(presets.iosX64) addTarget(presets.macosX64) - addTarget(presets.mingwX64) - addTarget(presets.tvosArm64) - addTarget(presets.tvosX64) - addTarget(presets.watchosArm32) - addTarget(presets.watchosArm64) - addTarget(presets.watchosX86) - addTarget(presets.watchosX64) + addTarget(presets.macosArm64) addTarget(presets.iosSimulatorArm64) + addTarget(presets.iosX64) + + // Tier 2 + addTarget(presets.linuxArm64) addTarget(presets.watchosSimulatorArm64) + addTarget(presets.watchosX64) + addTarget(presets.watchosArm32) + addTarget(presets.watchosArm64) addTarget(presets.tvosSimulatorArm64) - addTarget(presets.macosArm64) + addTarget(presets.tvosX64) + addTarget(presets.tvosArm64) + addTarget(presets.iosArm64) + + // Tier 3 + addTarget(presets.androidNativeArm32) + addTarget(presets.androidNativeArm64) + addTarget(presets.androidNativeX86) + addTarget(presets.androidNativeX64) + addTarget(presets.mingwX64) + addTarget(presets.watchosDeviceArm64) + + // Deprecated, but were provided by coroutine; can be removed only when K/N drops the target + addTarget(presets.iosArm32) + addTarget(presets.watchosX86) } sourceSets { From f3b970df33ea9b522ce0ce885722ac2e7c6afe24 Mon Sep 17 00:00:00 2001 From: Vsevolod Tolstopyatov Date: Fri, 24 Feb 2023 17:55:09 +0100 Subject: [PATCH 2/2] ~explicitly add android native into hmpp --- kotlinx-coroutines-core/build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kotlinx-coroutines-core/build.gradle b/kotlinx-coroutines-core/build.gradle index 84d9b0485d..2a6dbbc64f 100644 --- a/kotlinx-coroutines-core/build.gradle +++ b/kotlinx-coroutines-core/build.gradle @@ -84,7 +84,7 @@ void defineSourceSet(newName, dependsOn, includedInPred) { static boolean isNativeDarwin(String name) { return ["ios", "macos", "tvos", "watchos"].any { name.startsWith(it) } } -static boolean isNativeOther(String name) { return ["linux", "mingw"].any { name.startsWith(it) } } +static boolean isNativeOther(String name) { return ["linux", "mingw", "androidNative"].any { name.startsWith(it) } } defineSourceSet("concurrent", ["common"]) { it in ["jvm", "native"] }