diesieben07
09/15/2020, 4:59 PMposix
in code shared between Linux/OSX. However I cannot get this to work at all. I have set kotlin.mpp.enableGranularSourceSetsMetadata=true
and kotlin.native.enableDependencyPropagation=false
like described in the docs. Then I have created a nativeMain
source set:
val nativeMain by creating {
dependsOn(commonMain)
}
Then I have configured the linuxX64Main
and osxX64Main
source sets to depend on nativeMain
. However I still cannot use posix
in nativeMain
.
This issue happens both when trying to compile with Gradle as well as in IntelliJ (types / functions cannot be resolved).
What am I missing?aleksey.tomin
09/15/2020, 5:02 PMdiesieben07
09/15/2020, 5:05 PMmacosX64
does not help.
2. gradle build
does not work fine (like I said above). It shows "unresolved reference: platform" for import platform.posix.*
Big Chungus
09/15/2020, 5:38 PMkotlin {
osxX64("macosX64") {...}
}
Do
kotlin {
macosX64 {...}
}
diesieben07
09/15/2020, 5:39 PMosxX64
would not even compileBig Chungus
09/15/2020, 5:43 PMArkadii Ivanov
09/15/2020, 5:53 PMdiesieben07
09/15/2020, 6:02 PMmsink
09/16/2020, 10:01 AMkotlin {
linuxX64()
macosX64()
targets.withType<KotlinNativeTarget> {
sourceSets["${targetName}Main"].apply {
kotlin.srcDir("src/nativeMain/kotlin")
}
}
}