Created
December 15, 2019 16:01
-
-
Save jonnyzzz/65a4004eaf41559fb28dd44e34dbb776 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinNativeTargetWithTests | |
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform.getCurrentOperatingSystem | |
fun setupNative(name: String, | |
configure: KotlinNativeTargetWithTests.() -> Unit): KotlinNativeTargetWithTests { | |
val os = getCurrentOperatingSystem() | |
return when { | |
os.isLinux -> kotlin.linuxX64(name, configure) | |
os.isWindows -> kotlin.mingwX64(name, configure) | |
os.isMacOsX -> kotlin.macosX64(name, configure) | |
else -> error("OS $os is not supported") | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment