android {

    defaultConfig {
        externalNativeBuild {
            cmake {
                arguments '-DANDROID_TOOLCHAIN=clang', '-DANDROID_STL=c++_shared'
                cFlags '-std=c99', '-fstrict-aliasing'
                cppFlags '-std=c++11', '-fstrict-aliasing'
            }
        }
    }

    buildTypes {
        release {
            externalNativeBuild {
                cmake {
                    arguments '-DCMAKE_BUILD_TYPE=MinSizeRel'
                    cFlags '-g0', '-Os', '-fomit-frame-pointer', '-DNDEBUG', '-fvisibility=hidden'
                    cppFlags '-g0', '-Os', '-fomit-frame-pointer', '-DNDEBUG', '-fvisibility=hidden'
                }
            }
        }

        debug {
            externalNativeBuild {
                cmake {
                    arguments '-DCMAKE_BUILD_TYPE=MinSizeRel'
                    cFlags '-g', '-DDEBUG', '-DDUMP_LEAKS'
                    cppFlags '-g', '-DDEBUG', '-DDUMP_LEAKS'
                }
            }
        }
    }

    sourceSets {
        main {
//            jniLibs.srcDirs = ['src/main/jni/qjs/quickjs/libs']
            jniLibs.srcDirs = ['src/main/jni/napi/napi/libs/qjs']
        }
    }

    externalNativeBuild {
        cmake {
            path "src/main/jni/qjs/CMakeLists.txt"
        }
    }
}