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 android: { 38 static_libs: [ 39 "libbpf_android", 40 ], 41 }, 42 apex: { 43 exclude_static_libs: [ 44 "libbpf_android", 45 ], 46 }, 47 vendor: { 48 exclude_static_libs: [ 49 "libbpf_android", 50 ], 51 }, 52 darwin: { 53 enabled: false, 54 }, 55 56 }, 57} 58 59cc_library { 60 name: "libmeminfo", 61 host_supported: true, 62 native_bridge_supported: true, 63 vendor_available: true, 64 defaults: ["libmeminfo_defaults"], 65 export_include_dirs: [ 66 "include", 67 "libdmabufinfo/include", 68 ], 69 export_shared_lib_headers: ["libbase"], 70 srcs: [ 71 "pageacct.cpp", 72 "procmeminfo.cpp", 73 "sysmeminfo.cpp", 74 ], 75 76 apex_available: [ 77 "//apex_available:platform", 78 "com.android.art", 79 "com.android.art.debug", 80 ], 81 min_sdk_version: "S", 82} 83 84cc_test { 85 name: "libmeminfo_test", 86 test_suites: ["device-tests"], 87 defaults: ["libmeminfo_defaults"], 88 require_root: true, 89 90 static_libs: [ 91 "libc++fs", 92 "libmeminfo", 93 "libbase", 94 "liblog", 95 ], 96 97 shared_libs: ["libvintf"], 98 99 srcs: [ 100 "libmeminfo_test.cpp" 101 ], 102 103 data: [ 104 "testdata1/*", 105 "testdata2/*" 106 ], 107} 108 109cc_benchmark { 110 name: "libmeminfo_benchmark", 111 srcs: [ 112 "libmeminfo_benchmark.cpp", 113 ], 114 static_libs : [ 115 "libbase", 116 "liblog", 117 "libmeminfo", 118 "libprocinfo", 119 ], 120 121 data: [ 122 "testdata1/*", 123 ], 124} 125