Kotlin/Native has a utility, run_konan
, that can be used to compile C/C++ code.
I've written two Gradle tasks, RunKonanClangTask
and RunKonanClangTask
, that can be used to compile JoltC. A lot of credit goes to https://github.com/michal-z for writing C wrappers for Jolt!
This Gist is very scrappy, and is missing a lot of information.
- Kotlin 1.9.0
- I've only tested it on Windows.
- The Kotlin target must be set manually - is it possible to make this automatic?
- While the
.konan
dir can be retrieved from a KGP util function, the path to konan_run
file must be set manually (e.g. kotlin-native-prebuilt-windows-x86_64-1.9.0
) - is it possible to make this automatic?