Currently, kotlin/native Linux targets can be buil...
# kotlin-native
s
Currently, kotlin/native Linux targets can be built on Windows and macOS. Is there any potential for the reverse, i.e. Windows or macOS targets being able to be built on Linux?
I ask because I’d like my k/n libraries to support macOS on top of Linux and Windows, but I don’t own a macOS machine, and macOS VMs are notoriously difficult to set up. I’d also like to avoid having a Windows 7 VM set up for the sole purpose of building Windows targets.
d
This is available right now, although it's experimental.
s
Is it? I was aware of windows and macOS being able to compile Linux targets, but I didn’t think it could be done the other way around.
d
Windows can be built but you need to have Wine installed.
There was a proposal for macOS but was rejected for legal reasons. It probably won't be happening anytime soon or ever.
s
Yeah, that’s what I figured... I’ll try the Windows cross-compilation though, thanks!
t
apple being nice to devs lol
s
Is there documentation for the Wine cross-compilation, or do I have to actually run the compiler through wine?
According to the docs, it looks like I'd have to build the kotlin/native compiler myself, which isn't really an option seeing as I'm using the Gradle plugin.
d
Ahhh I see. I thought it had been released in mainstream.
s
Search the history in this channel. I believe a question asking about specifying the compiler location in the Gradle script was asked and answered.
s
I think I’ll just wait for it to become stable, or for the feature to be included by default in the compiler distribution.
o
You need to compile K/N with
-Porg.jetbrains.kotlin.native.experimentalTargets
for Windows targets on Linux/macOS hosts
b
@olonho any idea when that might be promoted to functionality that's part of K/N release builds, even if it's disabled by default?
5