Hi everyone! I've recently made <https://github.co...
# feed
m
Hi everyone! I've recently made KonanPlugin 🎉 — a custom Gradle plugin to simplify C/C++ compilation to make working with CInterop in Kotlin Native projects more enjoyable. Features: • Compiles C/C++ sources into object files (.o). • Links them into static libraries (.a). • Works seamlessly with all Kotlin/Native targets. The plugin is available on gradle portal 🛠️ For full setup and examples, check out the README: https://github.com/lemcoder/KonanPlugin Feedback and contributions are welcome. 😊
K 4
a
Looks interesting.
m
Thanks! The aim was to have a single codebase with kotlin and C sources. After compiling C sources to static libraries you can CInterop them and statically link them to your kotlin native code so the consumers of your library/module do not have to provide the implementations for the CInteropped code 🙌 The example -> https://github.com/lemcoder/MikroSoundFont
👍 4
c
I’m definitely giving this a try! Kudos!
🙌 1
z
This is cool. I'm wondering if maybe this could be extended to also support compiling C/C++ for the JVM?
a
C++ is a pain. It is not covered by CInterop and is not interoperable in general.
1
a
You didn't make this. This code is copied from my gist https://gist.github.com/aSemy/076591d565867839b6009f36c3b8b3ae
m
@Adam S I've updated readme to include your awesome work 🚀.