Big Chungus
04/04/2023, 9:09 AMAdam S
04/04/2023, 9:20 AMimplementation(project(":module-a"))
, but maybe IntelliJ takes a while to work it out.Big Chungus
04/04/2023, 9:21 AMAdam S
04/04/2023, 9:21 AMBig Chungus
04/04/2023, 9:22 AMAdam S
04/04/2023, 9:23 AMAdam S
04/04/2023, 9:24 AMbinaries.staticLib()
?
kotlin {
targets.withType<KotlinNativeTarget>().configureEach {
compilations.getByName("main") {
cinterops {
val extLib by creating {
defFileProperty.set(file("$projectDir/ext-lib.def"))
}
}
}
binaries { binaries.staticLib() }
}
}
Big Chungus
04/04/2023, 9:24 AMAdam S
04/04/2023, 9:24 AMBig Chungus
04/04/2023, 9:24 AMBig Chungus
04/04/2023, 9:25 AMAdam S
04/04/2023, 9:25 AMAdam S
04/04/2023, 9:26 AMAdam S
04/04/2023, 9:27 AMBig Chungus
04/04/2023, 9:28 AMBig Chungus
04/04/2023, 9:28 AMAdam S
04/04/2023, 9:29 AMBig Chungus
04/04/2023, 9:30 AMBig Chungus
04/04/2023, 9:30 AMBig Chungus
04/04/2023, 9:36 AMAdam S
04/04/2023, 9:37 AMAdam S
04/04/2023, 9:40 AMpackage cinterop.internal
public external fun SetTraceLogCallback(...)
so in commonMain I created an expect
expect fun setTraceLogCallbackInternal(...)
and then in linuxX64Main, macosX64Main, mingwX64Main I created actual functions that deferred to the generated functions for each target
actual fun setTraceLogCallbackInternal(...) {
cinterop.internal.SetTraceLogCallback(...)
}
vbsteven
04/04/2023, 11:00 AMapi
instead of implementation
?Big Chungus
04/04/2023, 11:00 AMvbsteven
04/04/2023, 11:04 AMvbsteven
04/04/2023, 11:05 AMdependencies {
implementation(project(":my-cinterop-bindings"))
api(project(":another-cinterop-bindings"))
}
Both approaches seem to make all the cinterop stub functions and types availablevbsteven
04/04/2023, 11:06 AMBig Chungus
04/04/2023, 11:07 AMBig Chungus
04/04/2023, 11:08 AMAdam S
04/04/2023, 3:48 PM