[Native] Enable parallel platform libs generation on parameter
Use kotlin.native.platformLibs.parallel to control parallel generation. Disable parallel execution of platform libs on MacOS aarch64
This commit is contained in:
@@ -25,6 +25,7 @@ ext.setProperty("org.jetbrains.kotlin.native.home", konanHome)
|
|||||||
ext.setProperty("konan.jvmArgs", jvmArgs)
|
ext.setProperty("konan.jvmArgs", jvmArgs)
|
||||||
|
|
||||||
apply plugin: 'konan'
|
apply plugin: 'konan'
|
||||||
|
apply plugin: 'java'
|
||||||
|
|
||||||
//#region Util functions.
|
//#region Util functions.
|
||||||
private ArrayList<DefFile> targetDefFiles(KonanTarget target) {
|
private ArrayList<DefFile> targetDefFiles(KonanTarget target) {
|
||||||
@@ -42,6 +43,14 @@ private String defFileToLibName(String target, String name) {
|
|||||||
}
|
}
|
||||||
//#endregion
|
//#endregion
|
||||||
|
|
||||||
|
if (HostManager.host.name == "macos_arm64") {
|
||||||
|
java {
|
||||||
|
toolchain {
|
||||||
|
languageVersion = JavaLanguageVersion.of(17)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: I think most for the non-DSL language below can either be incorporated into DSL
|
// TODO: I think most for the non-DSL language below can either be incorporated into DSL
|
||||||
// or moved out of .gradle file.
|
// or moved out of .gradle file.
|
||||||
rootProject.project("kotlin-native").ext.platformManager.enabled.each { target ->
|
rootProject.project("kotlin-native").ext.platformManager.enabled.each { target ->
|
||||||
@@ -85,7 +94,9 @@ rootProject.project("kotlin-native").ext.platformManager.enabled.each { target -
|
|||||||
libTask.configure {
|
libTask.configure {
|
||||||
it.dependsOn df.config.depends.collect { defFileToLibName(targetName, it) }
|
it.dependsOn df.config.depends.collect { defFileToLibName(targetName, it) }
|
||||||
it.dependsOn ":kotlin-native:${targetName}CrossDist"
|
it.dependsOn ":kotlin-native:${targetName}CrossDist"
|
||||||
it.enableParallel = true
|
it.enableParallel = project.hasProperty("kotlin.native.platformLibs.parallel")
|
||||||
|
? project.findProperty("kotlin.native.platformLibs.parallel")?.toString()?.toBoolean()
|
||||||
|
: HostManager.host != "macos_arm64"
|
||||||
}
|
}
|
||||||
|
|
||||||
def klibInstallTask = tasks.register("$libName", KlibInstall) {
|
def klibInstallTask = tasks.register("$libName", KlibInstall) {
|
||||||
|
|||||||
Reference in New Issue
Block a user