Derek Ellis
09/02/2020, 9:59 PMios()
but then use symlinks between the x86 and arm source sets. I can't seem to get any cocoapods imports to work in the shared iOS sourceset.Tijl
09/03/2020, 7:14 AMkotlin.mpp.enableGranularSourceSetsMetadata=false
and then still use the ios()
declaration, combined with
val iosX64Main by getting {
kotlin.srcDir("iosMain")
}
val iosArm64Main by getting {
kotlin.srcDir("iosMain")
}
This creates a warning when importing about overlapping sourcesets but it does not seem to break anything. In some projects by default I only use one of the two and pnly enable both when publishing.
As you already mention symlinking will also work (but I suspect it will break checkouts on Windows).Derek Ellis
09/03/2020, 2:47 PM//select iOS target platform depending on the Xcode environment variables
val iOSTarget: (String, KotlinNativeTarget.() -> Unit) -> KotlinNativeTarget =
if (System.getenv("SDK_NAME")?.startsWith("iphoneos") == true)
::iosArm64
else
::iosX64
iOSTarget("ios") {}