plugins { kotlin("multiplatform") version "KOTLIN_VERSION" } group = "me.user" version = "1.0-SNAPSHOT" repositories { mavenCentral() maven { url = uri("https://dl.bintray.com/kotlin/kotlin-dev") } } kotlin { val hostOs = System.getProperty("os.name") val isMingwX64 = hostOs.startsWith("Windows") val nativeTarget = when { hostOs == "Mac OS X" -> macosX64("native") hostOs == "Linux" -> linuxX64("native") isMingwX64 -> mingwX64("native") else -> throw GradleException("Host OS is not supported in Kotlin/Native.") } nativeTarget.apply { binaries { executable { entryPoint = "main" } } } sourceSets { val nativeMain by getting val nativeTest by getting } }