Adaptive native targets.
This commit is contained in:
parent
48bf26e26a
commit
1cc83e8803
@ -7,7 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
### Added
|
### Added
|
||||||
|
- Adaptive support for host OS in native
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
### Deprecated
|
### Deprecated
|
||||||
|
@ -18,10 +18,21 @@ class KScienceNativePlugin : Plugin<Project> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
configure<KotlinMultiplatformExtension> {
|
configure<KotlinMultiplatformExtension> {
|
||||||
//deploy mode
|
val hostOs = System.getProperty("os.name")
|
||||||
|
|
||||||
|
val isLinux = hostOs == "Linux"
|
||||||
|
val isMinGw = hostOs.startsWith("Windows")
|
||||||
|
val isMacOs = hostOs == "Mac OS X"
|
||||||
|
|
||||||
|
if (isLinux || isMinGw) {
|
||||||
linuxX64()
|
linuxX64()
|
||||||
|
}
|
||||||
|
if (isMinGw) {
|
||||||
mingwX64()
|
mingwX64()
|
||||||
|
}
|
||||||
|
if (isMacOs) {
|
||||||
macosX64()
|
macosX64()
|
||||||
|
}
|
||||||
|
|
||||||
sourceSets {
|
sourceSets {
|
||||||
val commonMain by getting
|
val commonMain by getting
|
||||||
@ -35,25 +46,29 @@ class KScienceNativePlugin : Plugin<Project> {
|
|||||||
dependsOn(commonTest)
|
dependsOn(commonTest)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isLinux) {
|
||||||
val linuxX64Main by getting {
|
val linuxX64Main by getting {
|
||||||
dependsOn(nativeMain)
|
dependsOn(nativeMain)
|
||||||
}
|
}
|
||||||
|
val linuxX64Test by getting {
|
||||||
|
dependsOn(nativeTest)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isMinGw) {
|
||||||
val mingwX64Main by getting {
|
val mingwX64Main by getting {
|
||||||
dependsOn(nativeMain)
|
dependsOn(nativeMain)
|
||||||
}
|
}
|
||||||
|
|
||||||
val macosX64Main by getting {
|
|
||||||
dependsOn(nativeMain)
|
|
||||||
}
|
|
||||||
|
|
||||||
val linuxX64Test by getting {
|
|
||||||
dependsOn(nativeTest)
|
|
||||||
}
|
|
||||||
|
|
||||||
val mingwX64Test by getting {
|
val mingwX64Test by getting {
|
||||||
dependsOn(nativeTest)
|
dependsOn(nativeTest)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isMacOs) {
|
||||||
|
val macosX64Main by getting {
|
||||||
|
dependsOn(nativeMain)
|
||||||
|
}
|
||||||
|
|
||||||
val macosX64Test by getting {
|
val macosX64Test by getting {
|
||||||
dependsOn(nativeTest)
|
dependsOn(nativeTest)
|
||||||
@ -62,3 +77,4 @@ class KScienceNativePlugin : Plugin<Project> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user