2020-10-04 08:45:35 +03:00
|
|
|
@file:Suppress("UNUSED_VARIABLE")
|
|
|
|
|
2020-10-05 09:13:06 +03:00
|
|
|
import kscience.kmath.gsl.codegen.matricesCodegen
|
2020-10-05 13:46:41 +03:00
|
|
|
import kscience.kmath.gsl.codegen.vectorsCodegen
|
2020-10-05 09:13:06 +03:00
|
|
|
|
2020-10-04 08:45:35 +03:00
|
|
|
plugins {
|
2020-10-04 10:10:53 +03:00
|
|
|
id("ru.mipt.npm.mpp")
|
2020-10-04 08:45:35 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
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 16:17:44 +03:00
|
|
|
|
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/") }
|
2020-10-04 08:45:35 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-10-05 09:13:06 +03:00
|
|
|
sourceSets {
|
|
|
|
val nativeMain by getting {
|
2020-10-10 23:37:04 +03:00
|
|
|
val codegen by tasks.creating {
|
|
|
|
matricesCodegen(kotlin.srcDirs.first().absolutePath + "/kscience/kmath/gsl/_Matrices.kt")
|
|
|
|
vectorsCodegen(kotlin.srcDirs.first().absolutePath + "/kscience/kmath/gsl/_Vectors.kt")
|
|
|
|
}
|
|
|
|
|
|
|
|
kotlin.srcDirs(files().builtBy(codegen))
|
|
|
|
|
2020-10-05 09:13:06 +03:00
|
|
|
dependencies {
|
|
|
|
api(project(":kmath-core"))
|
|
|
|
api("org.jetbrains.kotlinx:kotlinx-io:0.2.0-tvis-3")
|
|
|
|
}
|
2020-10-04 08:45:35 +03:00
|
|
|
}
|
|
|
|
}
|
2020-10-10 21:24:16 +03:00
|
|
|
}
|