https://kotlinlang.org logo
Title
k

kpgalligan

06/23/2018, 1:15 AM
The klib format has a 'native' folder in which we could presumably put bc files from c++ compilation. I have c++ compile and kotlin/native compile happening in different targets, with the c++ referenced with 'nativeLibraries' in the gradle config. Is there a good way to get those native artifacts into the klib without trying to directly manipulate the zip file? From this project: https://github.com/touchlab/knarch.db
r

russhwolf

06/23/2018, 1:36 AM
So if I’m reading your gradle files correctly (and I haven’t pulled this stuff and tried to build it yet so I could be off-base), you’re pulling in the c++ dependency (
tlruntime.bc
) separately from your klib in your sample projects. Why not include the
nativeLibraries
items directly in the
libraries
block in
knarch-ios/build.gradle
? I would think that would generate a klib with everything you need to use as a single dependency.
You’d need to generate different klibs for x64 and arm64 but you’re already configuring their dependencies separately anyway
k

kpgalligan

06/23/2018, 4:06 AM
I was about to write back, "but I am!" and I'm not. Let's see...
Well, that 100% worked. I haven't tried downstream in samples yet, but klib has the c++ output. Thanks!
Worked! Nice.
👍 1