macoswindowexecompose-multiplatformcompose-desktop

Cross-compile Compose Multiplatform project to EXE


I am trying Compose Multiplatform example project on my Macbook. When I call ./gradlew :createDistributable I see only MacOS executable in /build/compose/binaries/main/ directory. Is it possible to create Windows executable (*.exe) on Macbook?

Upd.:

my build.gradle.kts file

...
compose.desktop {
    application {
        mainClass = "MainKt"
        nativeDistributions {
            targetFormats(TargetFormat.Dmg, TargetFormat.Deb, TargetFormat.Exe)
            packageName = "HelloComposeMultiplatform"
            packageVersion = "1.0.0"
            windows {
                packageVersion = "1.0.0"
                msiPackageVersion = "1.0.0"
                exePackageVersion = "1.0.0"
            }
        }
    }
}


Solution

  • Based on this documentation there is no cross-compilation support at the moment. So it's not possible.

    There is no cross-compilation support available at the moment, so the formats can only be built using the specific OS (e.g. to build .dmg you have to use macOS). Tasks that are not compatible with the current OS are skipped by default.

    For example for creating Windows installers is used Wix toolset available for Windows only.