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).
👍 1
d
Derek Ellis
09/03/2020, 2:47 PM
I worked around it by sticking to the good ol' environment variable lookup:
Copy code
//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") {}