I have a Kotlin Native application. It compiles to...
# kotlin-native
s
I have a Kotlin Native application. It compiles to
mingwX64
and
macosX64
. It also uses a library via cinterop that works with Mac and Windows, and shares the same header files. The problem is that in my project, the library ONLY seems accessible in the mingwX64 or the macosX64 source set. Creating expect/actuals for every single type would be extremely cumbersome. I have
kotlin.mpp.enableGranularSourceSetsMetadata=true
. Something tells me this is supposed to work, but I’ve just done something wrong. Should this be working?
r
cinterop with third-party libs needs an addtional gradle flag. Add
kotlin.mpp.enableCInteropCommonization=true
to gradle.properties. See also https://kotlinlang.org/docs/mpp-share-on-platforms.html#use-native-libraries-in-the-hierarchical-structure
👍 2
s
Russel, if this works, this will be the 3rd time you’ve bailed me out bro.
It does. Thank you so much. I really appreciate it!
💪 4
😂 2
👍 6
a
Russel the bailer 😂