Lately I’ve been messing around a lot with cinterop and a C game development library called Raylib. It works perfectly fine on Native (almost too well) but that library can also export to wasm via emscripten. I know that with cinterop you can technically create a library even for wasm by passing -target wasm32 but is there any way to connect cinterop .klib with wasm and get a get it to work? I tried exporting bitcode and use bitcode with emscripten but it complained about “konan” bits present in it
b
bashor
01/10/2023, 6:18 PM
Note
wasm32
target in Kotlin/Native will be deprecated in favor of the new (dedicated) Kotlin/Wasm compiler backend.
bashor
01/10/2023, 6:20 PM
Speaking about using the library compiled by emscripten, it’s possible but could be tricky now — right now you need write glue code and required declarations manually. In the future it should be simpler.
k
Krystian
01/10/2023, 6:42 PM
Would there be any examples of that by any chance? I’ve been scavenging everywhere for something to take a look as I wish to one day get the cinterop lib not only be on native but also have ability to export to web via emscripten