https://kotlinlang.org logo
v

vbsteven

01/04/2023, 12:14 PM
For binary projects (for example an application I want to distribute) I can configure this custom sqlite3 build in my build scripts and provide the .so (or static .a) as part of the application package. But I'm not sure how to handle this situation when writing a library.
k

kpgalligan

01/04/2023, 6:58 PM
You can add a native library to a klib. There are 2 ways that I know of:
-include-binary
to add static libs (
*.a
) and
-native-library
to add a compiled bitcode library (
*.bc
). We include C/Objc code into libraries using a library that we definitely do not support because even with that disclaimer we get all kinds of questions, usually related to not understanding llvm, etc. https://github.com/touchlab/cklib. It uses kotlin compiler settings to build C/Objc and pack it in klibs. Live example: https://github.com/cashapp/zipline/blob/trunk/zipline/build.gradle.kts#L154
4 Views