apply plugin: 'com.android.library'

android {

    compileSdkVersion 31

    defaultConfig {
        minSdkVersion 21
    }
    defaultPublishConfig "StaticCppRelease"

    defaultConfig {
        externalNativeBuild {
            cmake {
                abiFilters 'armeabi', 'armeabi-v7a', 'arm64-v8a', 'x86', 'x86_64'
            }
        }
    }
    buildTypes {
        release {
            minifyEnabled false
            externalNativeBuild {
                cmake {
                    cppFlags "-fvisibility=hidden", "-funwind-tables", "-fasynchronous-unwind-tables"
                }
            }
//            debuggable true
//            jniDebuggable true
        }
        debug {
            jniDebuggable true
        }
    }
//    externalNativeBuild {
//        cmake {
//            path "CMakeLists.txt"
//            version "3.8.0+"
//        }
//    }

    flavorDimensions "stl_mode"
    productFlavors {
        StaticCpp {
            dimension "stl_mode"
            ext.artifactIdSuffix = 'static'
            externalNativeBuild {
                cmake {
                    arguments = ["-DANDROID_STL=c++_static"]
                }
            }
        }
    }
}

dependencies {
    implementation 'androidx.annotation:annotation:1.3.0'
}
