I'm confused on cross compilation I see that proj...
# kotlin-native
z
I'm confused on cross compilation I see that projects are using macos runner on GitHub to compile but what I don't understand is how they're building for Linux and Windows on MacOS I thought platforms could only compile their respective targets, did something change? Is there somewhere I can look that details what can be built on what?
a
https://kotlinlang.org/docs/multiplatform-publish-lib.html#host-requirements To rephrase: Kotlin supports cross-compilation, allowing any host to produce any artifacts, except for Apple platform targets, which require macOS
☝️ 2
💯 1
e
perhaps you are mixed up with the need to be on the same platform to use jpackage, which Compose Multiplatform uses for desktop packaging. but that's unrelated to Kotlin Native
r
Also remember that cross-compilation lets you build, but not run. If you want to run native desktop tests in ci, you need to use a host on the same platform.
💯 1
z
Ohh okay thank you all so much for clarifying
m
Does that also mean that I can build and publish any Compose Multiplatform library for any platform from a macOS host because building a library doesn’t involve the use of jpackage.
👀 1
e
yes
s
Multiplatform library for any platform from a macOS host
I think that’s true only if you are not using cinterop ..rt?
e
the topic has drifted a bit… compose desktop isn't kotlin native so there's no cinterop. there is for compose ios, but that's not an issue on macos hosts
👍 1
s
Yeah got it..i was mainly talking about kotlin multiplatform cross compilation of desktop native targets. Thanks!
👍 1