package {
    // See: http://go/android-license-faq
    // A large-scale-change added 'default_applicable_licenses' to import
    // all of the 'license_kinds' from "frameworks_av_license"
    // to get the below license kinds:
    //   SPDX-license-identifier-Apache-2.0
    default_applicable_licenses: ["frameworks_av_license"],
}

cc_library_headers {
    name: "libcodec2_headers",
    vendor_available: true,
    min_sdk_version: "29",
    apex_available: [
        "//apex_available:platform",
        "com.android.media.swcodec",
    ],
    export_include_dirs: ["include"],
}

cc_library {
    name: "libcodec2",
    vendor_available: true,
    min_sdk_version: "29",
    apex_available: [
        "//apex_available:platform",
        "com.android.media.swcodec",
    ],
    double_loadable: true,

    srcs: ["C2.cpp"],

    cflags: [
        "-Wall",
        "-Werror",
    ],

    header_abi_checker: {
        check_all_apis: true,
    },

    header_libs: [
        "libcodec2_headers",
        "libhardware_headers",
        "libutils_headers",
        "media_plugin_headers",
    ],

    export_header_lib_headers: [
        "libcodec2_headers",
        "libhardware_headers",
        "libutils_headers",
        "media_plugin_headers",
    ],

    sanitize: {
        misc_undefined: [
            "unsigned-integer-overflow",
            "signed-integer-overflow",
        ],
        cfi: false, // true,
        diag: {
            cfi: false, // true,
        },
    },

    ldflags: ["-Wl,-Bsymbolic"],
}
