1//
2// Copyright (C) 2018 The Android Open Source Project
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8//      http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15//
16
17package {
18    default_applicable_licenses: ["Android-Apache-2.0"],
19}
20
21cc_defaults {
22    name: "libmeminfo_defaults",
23    cflags: [
24        "-Wall",
25        "-Werror",
26    ],
27
28    shared_libs: [
29        "libbase",
30        "liblog",
31        "libprocinfo",
32    ],
33    static_libs: [
34        "libdmabufinfo",
35    ],
36    target: {
37        darwin: {
38            enabled: false,
39        },
40
41    },
42}
43
44cc_library {
45    name: "libmeminfo",
46    host_supported: true,
47    native_bridge_supported: true,
48    vendor_available: true,
49    defaults: ["libmeminfo_defaults"],
50    export_include_dirs: [
51        "include",
52        "libdmabufinfo/include",
53    ],
54    export_shared_lib_headers: ["libbase"],
55    header_libs: ["bpf_headers"],
56    srcs: [
57        "androidprocheaps.cpp",
58        "pageacct.cpp",
59        "procmeminfo.cpp",
60        "sysmeminfo.cpp",
61    ],
62
63    apex_available: [
64        "//apex_available:platform",
65        "com.android.art",
66        "com.android.art.debug",
67    ],
68    min_sdk_version: "S",
69}
70
71cc_test {
72    name: "libmeminfo_test",
73    test_suites: ["device-tests"],
74    defaults: ["libmeminfo_defaults"],
75    require_root: true,
76
77    static_libs: [
78        "libmeminfo",
79        "libbase",
80        "liblog",
81    ],
82
83    shared_libs: ["libvintf"],
84
85    srcs: [
86        "libmeminfo_test.cpp",
87    ],
88
89    data: [
90        "testdata1/*",
91        "testdata2/*",
92    ],
93}
94
95cc_benchmark {
96    name: "libmeminfo_benchmark",
97    srcs: [
98        "libmeminfo_benchmark.cpp",
99    ],
100    static_libs: [
101        "libbase",
102        "liblog",
103        "libmeminfo",
104        "libprocinfo",
105    ],
106
107    data: [
108        "testdata1/*",
109    ],
110}
111