david.bilik
02/26/2018, 8:43 AMgenerateCmake
generate CMakeList with all interop setup and used libraries? Because for me it does notilya.matveev
02/26/2018, 9:29 AMbuild.gradle
and the CMake file generated from it?david.bilik
02/26/2018, 9:32 AMbuild.gradle
apply plugin: 'konan'
buildscript {
repositories {
maven {
url "<https://dl.bintray.com/jetbrains/kotlin-native-dependencies>"
}
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-native-gradle-plugin:+"
}
}
konan.targets = ['iphone_sim']
konanArtifacts {
def productsDir = new File("../ios/Frameworks")
println(productsDir)
interop("libs") {
defFile "src/main/c_interop/libs.def"
compilerOpts "-F${productsDir}"
linkerOpts "-F${productsDir}"
includeDirs new File(".").getAbsolutePath()
}
framework('ComapLike', targets: ['iphone_sim']) {
srcDir 'src/main/kotlin'
enableMultiplatform true
enableDebug false
linkerOpts "-F${productsDir}"
libraries {
artifact "libs"
}
}
}
dependencies {
expectedBy project(':common')
}
and generated CMakeList
cmake_minimum_required(VERSION 3.8)
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/KotlinCMakeModule)
project(common-ios Kotlin)
If I import this to CLion, I cant see the classes from my libs.def definition (which contains some ios frameworks)olonho
02/26/2018, 9:48 AMgenerateCmake
is a workaround for lacking Gradle support in CLion. It is being fixed, and so for now we'd suggest to not use this workaround and just call Gradle from XCode.david.bilik
02/26/2018, 9:50 AMolonho
02/26/2018, 11:21 AMdavid.bilik
02/26/2018, 12:04 PM.klib
file and import it thereVyacheslav Karpukhin [JB]
02/28/2018, 8:24 PMkonanc_library
command, and then link it to the executable. If you have a .klib, then you can add it to your CMake project using a klib
command.
I hope that helps. Please let me know, if you have any other questions.