How config cmake in kotlin multiplatform project? ...
# kotlin-native
j
How config cmake in kotlin multiplatform project? When config as the following DSL in build.gradle
Copy code
android {

    defaultConfig {
        externalNativeBuild {
            cmake {
                abiFilters  "arm64-v8a","armeabi-v7a"
            }
        }
    }

    externalNativeBuild {
        cmake {
            path 'CMakeLists.txt'
        }
    }
}

kotlin {
    macosX64(){
    }
    linuxX64() {
    }
}
I got an CONFIGURE FAILED error: ABIs [armeabi] are not supported for platform. Supported ABIs are [arm64-v8a, armeabi-v7a, x86, x86_64]. My project structure is shown in the attached image, How can I solve it?
a
Hello, @Jeff Beyond! Can you explain a bit - what exactly you’re trying to do here? Are you trying to use CMake as to build Kotlin/Native Android target? I’m not sure this would work correctly.
k
it's my understanding
abiFilters
goes in
defaultConfig.ndk
oh I see the difference:
Copy code
/**
     * Specifies the Application Binary Interfaces (ABI) that Gradle should build outputs for. The
     * ABIs that Gradle packages into your APK are determined by {@link
     * com.android.build.gradle.internal.dsl.NdkOptions#abiFilter
     * android.defaultConfig.ndk.abiFilter}
I would try that as a first step
j
@Artyom Degtyarev [JB] My project used to be an Android project, which contained a part of jni logic implemented in C++ and build with cmake. I am now transforming it into a kotlin multiplatform project, but I want to keep the jni logic written in C ++ and cmake build to support android target, is this possible?
@Kris Wong so what should I do?
k
i think my recommendation was pretty clear. is there a particular part that's confusing?
j
@Kris Wong I tried it, but it did not work.
k
that's unfortunate
207 Views