1// Copyright 2017 The Android Open Source Project
2
3metricslogger_lib_src_files = [
4    "metrics_logger.cpp",
5]
6
7cc_defaults {
8    name: "metricslogger_defaults",
9
10    clang: true,
11    host_supported: true,
12
13    export_include_dirs: ["include"],
14    local_include_dirs: ["include"],
15    shared_libs: ["liblog"],
16    whole_static_libs: ["libgtest_prod"],
17
18    cflags: [
19        "-Wall",
20        "-Wextra",
21        "-Werror",
22
23        // 524291 corresponds to sysui_histogram, from
24        // frameworks/base/core/java/com/android/internal/logging/EventLogTags.logtags
25        "-DHISTOGRAM_LOG_TAG=524292",
26    ],
27}
28
29// metricslogger shared library
30// -----------------------------------------------------------------------------
31cc_library_shared {
32    name: "libmetricslogger",
33    vendor_available: true,
34    srcs: metricslogger_lib_src_files,
35    defaults: ["metricslogger_defaults"],
36}
37
38// metricslogger shared library, debug
39// -----------------------------------------------------------------------------
40cc_library_shared {
41    name: "libmetricslogger_debug",
42    srcs: metricslogger_lib_src_files,
43    defaults: ["metricslogger_defaults"],
44
45    target: {
46        host: {
47            cflags: ["-UNDEBUG"],
48        },
49    },
50}
51
52// Native tests
53// -----------------------------------------------------------------------------
54cc_test {
55    name: "metricslogger_tests",
56    defaults: ["metricslogger_defaults"],
57    shared_libs: [
58        "libbase",
59        "libmetricslogger_debug",
60    ],
61    static_libs: ["libBionicGtestMain"],
62    srcs: [
63        "metrics_logger_test.cpp",
64    ],
65}
66