Wednesday, 23 September 2020

Pass architecture information from gradlew command to cmake

I have an android application supporting 4 different architectures namely armeabi-v7a, arm64-v8a, x86 and x86_64. I don't want each of these architectures to be built for every Android built. I want to pass the architecture information as an argument via the gradlew command so that the builds of remaining architectures is skipped. I am aware that -DANDROID_ABI flag passed as an argument to cmake would do the trick but not sure how to pass it as an argument via the gradlew command?

defaultConfig {
    minSdkVersion 21
    targetSdkVersion 26

    externalNativeBuild {
        cmake {
            cppFlags "-frtti -fexceptions"
            arguments "-DANDROID_ABI=<<requested arch to built>>"
        }
    }
}

In other words, How can this information be passed from the gradlew command to the cmake?



from Pass architecture information from gradlew command to cmake

No comments:

Post a Comment