Workaround to turn off cross compilation on Windows that breaks cinterop (#2728)

This commit is contained in:
LepilkinaElena
2019-02-27 17:42:23 +03:00
committed by GitHub
parent 8cc6e67cee
commit 204254b266
+19
View File
@@ -32,6 +32,14 @@ repositories {
}
}
def getHostName() {
def target = System.getProperty("os.name")
if (target == 'Linux') return 'linux'
if (target.startsWith('Windows')) return 'windows'
if (target.startsWith('Mac')) return 'macos'
return 'unknown'
}
kotlin {
sourceSets {
commonMain {
@@ -122,6 +130,17 @@ kotlin {
}
configure([windows, linux, macos]) {
def isCurrentHost = (name == getHostName())
compilations.all {
cinterops.all {
project.tasks[interopProcessingTaskName].enabled = isCurrentHost
}
compileKotlinTask.enabled = isCurrentHost
}
binaries.all {
linkTask.enabled = isCurrentHost
}
binaries {
executable('benchmarksAnalyzer', [RELEASE]) {
if (org.gradle.internal.os.OperatingSystem.current().isWindows()) {