breandan
09/29/2019, 3:51 AMplugins {
kotlin("multiplatform")
id("org.kotlin.commonlibs")
}
commonLibs {
compile("opencv2")
}
And it downloads the appropriate klib
containing all the dependencies, which can be linked against the generated stubs and called from Kotlin/Native code without any further configuration.
With JavaCPP this is dead simple, you just add the Maven coordinates and can immediately call native libraries (bundled in the JAR) on any target architecture. https://github.com/bytedeco/javacpp-presetsnapperley
09/29/2019, 9:50 PMnapperley
09/29/2019, 9:55 PMnapperley
09/29/2019, 10:04 PMbreandan
09/30/2019, 1:15 AMgildor
09/30/2019, 1:43 AMmsink
09/30/2019, 2:11 AMgildor
09/30/2019, 2:23 AMgildor
09/30/2019, 2:23 AMmsink
09/30/2019, 2:31 AMgildor
09/30/2019, 2:34 AMmsink
09/30/2019, 2:36 AMmsink
09/30/2019, 2:44 AMmsink
09/30/2019, 2:56 AMjavacpp
didn't it in the same way - there should be reason for creating plugin?breandan
09/30/2019, 4:56 AMnapperley
09/30/2019, 8:24 PM"Currently it works only for C or ObjectiveC, and static linking."
Also works with Kotlin Native libraries that are packaged as a KLib, and published via the maven-publish Gradle plugin.gildor
10/01/2019, 5:01 AMif it were as easy as adding a dependency@breandan It’a already supported using Gradle dependencies management. So consume dependencies is ease, the hardest part is publishing, essentially configure build process and cinterop, but by itself is supported
napperley
10/03/2019, 9:13 PM