kmath/kmath-gsl/build.gradle.kts

44 lines
1.1 KiB
Plaintext
Raw Normal View History

@file:Suppress("UNUSED_VARIABLE")
import kscience.kmath.gsl.codegen.matricesCodegen
plugins {
2020-10-04 10:10:53 +03:00
id("ru.mipt.npm.mpp")
}
kotlin {
2020-10-04 11:53:24 +03:00
val nativeTarget = when (System.getProperty("os.name")) {
"Mac OS X" -> macosX64("native")
"Linux" -> linuxX64("native")
2020-10-04 11:53:24 +03:00
else -> {
logger.warn("Current OS cannot build any of kmath-gsl targets.")
return@kotlin
}
2020-10-04 10:10:53 +03:00
}
val main by nativeTarget.compilations.getting {
cinterops {
2020-10-04 09:19:49 +03:00
val libgsl by creating {
defFile("src/nativeInterop/cinterop/libgsl.def")
includeDirs { allHeaders("./src/nativeMain/resources/") }
}
}
}
sourceSets {
val nativeMain by getting {
dependencies {
api(project(":kmath-core"))
api("org.jetbrains.kotlinx:kotlinx-io:0.2.0-tvis-3")
}
}
}
}
internal val codegen: Task by tasks.creating {
matricesCodegen(kotlin.sourceSets["nativeMain"].kotlin.srcDirs.first().absolutePath + "/generated/Matrices.kt")
}
kotlin.sourceSets["nativeMain"].kotlin.srcDirs(files().builtBy(codegen))