Hello everyone!
I wanted to ask for an advice:
There is a C library that I want to create multiplatform library wrapper for and use it in a multiplatform project (say, targeting jvm, android and iOS).
I foresee 2 paths for implementation:
1. For jvm and android create jni interface and call the C lib through it. For native it would use just cinterop. Expect/actual mechanism for the common code.
2. Create a Kotlin/Native wrapper for C with cinterop, provide jni through @CName annotations and use the wrapper itself for jvm targets (completely hiding original c lib from platform code). Expect/actual as in variant 1.
What would be a better way? Any details I should be aware of?
Any advice about such a project, links or references highly appreciated, thanks!