I am creating KMP library and looking for the options how to solve following. On iOS part I am using some 3rd party framework to delegate some work and do some computations.
I was able to succesfully create cinterop definitions, here is the part of the build.gradle.kts for the library
kotlin {
androidTarget {
publishLibraryVariants("release", "debug")
compilations.all {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
listOf(
iosX64(),
iosArm64(),
iosSimulatorArm64()
).forEach {
val slice = when (it.name) {
"iosArm64" -> "ios-arm64"
else -> "ios-arm64-simulator"
}
it.binaries.all {
linkerOpts(
"-framework", "3rdParty",
"-F$projectDir/directoryWith3rdPartyFramework/"
)
}
it.binaries.framework {
baseName = "shared"
isStatic = true
}
it.compilations.getByName("main") {
cinterops.create("Prod1") {
defFile("$projectDir/src/nativeInterop/cinterop/Prod1.def")
compilerOpts("-framework", "3rdParty", "-F$projectDir/directoryWith3rdPartyFramework/")
}
}
}
def file contains only
language = Objective-C
modules = moduleName
package = com.3rdPartyFramework
everything is working fine but I dont know what are my options how to distribute the library? As of now my framework here is file sitting next to my source code. If someone else would like to use the library how he get to the 3rdpartyframework? I was thinking of using cocoapods? Can anyone recommend or point me to right direction? Thanks