-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix dynamic framework support and fix binary compatibility of SkikoUI… #763
Conversation
…View This change configures Kotlin Gradle plugin to include a CInterop def file (https://kotlinlang.org/docs/native-c-interop.html) to fix linking a dynamic framework for iOS Also helps with https://youtrack.jetbrains.com/issue/KT-60399 (at least in some cases). Internal discussion https://jetbrains.slack.com/archives/G017NLN12D8/p1689594898607469
d9c72be
to
a930272
Compare
@@ -427,6 +428,32 @@ kotlin { | |||
} | |||
} | |||
|
|||
fun configureCinterop( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the property enableCInteropCommonization
for something else? (docs doesn't say its purpose clearly)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
enableCInteropCommonization
is used to tell Kotlin Gradle plugin to commonize multiple CInterop libraries.
So for example, for the following configuration:
kotlin {
linuxX64 {
compilations.getByName("main") {
cinterops.create("foo").apply { ... }
}
}
linuxArm64 {
compilations.getByName("main") {
cinterops.create("foo").apply { ... }
}
}
sourceSets {
val commonMain by getting
val linuxCommonMain by creating { dependsOn(commonMain) }
val linuxX64Main by getting { dependsOn(linuxCommonMain) }
val linuxArm64Main by getting { dependsOn(linuxCommonMain) }
}
}
cinterop creates two platform specific libraries: cinterop-foo-x64.klib
and cinterop-foo-arm64.klib
By default, cinterop-foo
declarations would be available only in platform specific source sets.
So consumers would not be able to use foo
declarations in linuxCommon source sets.
kotlin.mpp.enableCInteropCommonization=true
generates commonized klib with common declarations for linuxCommonMain
(and its consumers).
I don't think we need this flag now, since we don't need to commonize any cinterop declarations.
…View
This change configures Kotlin Gradle
plugin to include a CInterop def file
(https://kotlinlang.org/docs/native-c-interop.html) to fix linking a dynamic framework for iOS
Also helps with https://youtrack.jetbrains.com/issue/KT-60399 (at least in some cases). Internal discussion https://jetbrains.slack.com/archives/G017NLN12D8/p1689594898607469