I’m creating a command line tool, that need to be ...
# kotlin-native
g
I’m creating a command line tool, that need to be compatible for mac/win/linux machines, also, i’m using only posix as dependency and the code should be exactly the same, but in commonMain looks like i cannot use it! going through the internet, i can find so many different approaches like konan or kotlin-multiplatform any idea or useful links about that?
j
you may use Kotlin multiplatform project to configure your build and project. It will open in IntelliJ IDEA or CLion.
To start with, update your Kotlin plugin in the idea and select Kotlin / Kotlin/Native from the New Project wizard in IntellJ or CLion
There is a tutorial, but it uses non-Gradle approach https://kotlinlang.org/docs/tutorials/native/targeting-multiple-platforms.html
g
Thanks for your answer! yeah i did it! with gradle i found something but using konan..
also another question, it is possible to produce the three executable in one shot from the same machine? cross-compiling i mean
d
you can compile mac only from mac and same goes for windows afaik
r
https://youtrack.jetbrains.com/issue/KT-27320 This seems to cover your concern on using shared Native source set, so feel free to star it for yourself. You can also dig through linked issues to find something a bit more appropriate if needed.