apply plugin: 'com.android.library'

android {
    compileSdkVersion 28
    // a default can be used, but it is good practice to explicitly select build tools
    buildToolsVersion '28.0.3'

    defaultConfig {
        // applicationId 'xyz.nc.android.wc'
        minSdkVersion 23
        targetSdkVersion 28
        versionCode 1
        versionName '1.0'

        externalNativeBuild {
            cmake {
                arguments '-DANDROID_PLATFORM=android-23',
                          '-DANDROID_TOOLCHAIN=clang'
                // Sets optional flags for the C compiler.
                // Some defines are located here:
                //   https://www.wolfssl.com/docs/wolfssl-manual/ch2/
                // Others were found in the source code, for example "#ifndef WOLFCRYPT_ONLY" in internal.c
                cFlags \
                    '-DWOLFCRYPT_ONLY',
                    '-DNO_DSA',          '-DNO_MD4',         '-DHAVE_CURVE25519',
                    '-DHAVE_ED25519',    '-DHAVE_ECC',       '-DHAVE_POLY1305',
                    '-DHAVE_CHACHA',     '-DHAVE_CAMELLIA',  '-DHAVE_AESGCM',
                    '-DHAVE_AESCCM',     '-DWOLFSSL_SHA512', '-DWOLFSSL_RIPEMD',
                    '-DWOLFSSL_KEY_GEN', '-DHAVE_HC128'


                    // ARMv8 hardware acceleration
                    // '-DWOLFSSL_ARMASM'

                    // x86
                    // '-DWOLFSSL_AESNI'
            }
           
        }
    }

    flavorDimensions "arch"
    productFlavors {
        arm8 {
            dimension "arch"
        }
        x86 {
            dimension "arch"
        }
    }

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