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

cc_library_static {
    name: "gfxstream_base",
    defaults: ["gfxstream_defaults"],
    srcs: [
        "AlignedBuf.cpp",
        "CompressingStream.cpp",
        "CpuTime.cpp",
        "DecompressingStream.cpp",
        "FileUtils.cpp",
        "FunctorThread.cpp",
        "GLObjectCounter.cpp",
        "HealthMonitor.cpp",
        "LayoutResolver.cpp",
        "MemStream.cpp",
        "StdioStream.cpp",
        "MemoryTracker.cpp",
        "MessageChannel.cpp",
        "Metrics.cpp",
        "PathUtils.cpp",
        "ring_buffer.cpp",
        "SharedLibrary.cpp",
        "SharedMemory_posix.cpp",
        "StringFormat.cpp",
        "Stream.cpp",
        "StreamSerializing.cpp",
        "SubAllocator.cpp",
        "System.cpp",
        "Tracing.cpp",
        "Thread_pthread.cpp",
    ],
    header_libs: ["libgfxstream_thirdparty_renderdoc_headers"],
    export_header_lib_headers: ["libgfxstream_thirdparty_renderdoc_headers"],
    static_libs: ["liblz4"],
}

// Run with `atest --host gfxstream_base_tests`
cc_test_host {
    name: "gfxstream_base_tests",
    defaults: ["gfxstream_defaults"],
    srcs: [
        "LruCache_unittest.cpp",
    ],
    static_libs: [
        "gfxstream_base",
        "libgmock",
        "libgtest",
        "libgtest_main",
    ],
    test_options: {
        unit_test: true,
    },
}

cc_test_library {
    name: "gfxstream_base_test_support",
    defaults: ["gfxstream_defaults"],
    srcs: [
        "testing/file_io.cpp",
    ],
    static_libs: [
        "gfxstream_base",
    ],
}