1// Copyright (C) 2010 The Android Open Source Project 2// 3// Licensed under the Apache License, Version 2.0 (the "License"); 4// you may not use this file except in compliance with the License. 5// You may obtain a copy of the License at 6// 7// http://www.apache.org/licenses/LICENSE-2.0 8// 9// Unless required by applicable law or agreed to in writing, software 10// distributed under the License is distributed on an "AS IS" BASIS, 11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12// See the License for the specific language governing permissions and 13// limitations under the License. 14 15cc_library_shared { 16 name: "libui", 17 vendor_available: true, 18 vndk: { 19 enabled: true, 20 }, 21 double_loadable: true, 22 23 clang: true, 24 cflags: [ 25 "-Wall", 26 "-Werror", 27 ], 28 cppflags: [ 29 "-Weverything", 30 31 // The static constructors and destructors in this library have not been noted to 32 // introduce significant overheads 33 "-Wno-exit-time-destructors", 34 "-Wno-global-constructors", 35 36 // We only care about compiling as C++14 37 "-Wno-c++98-compat-pedantic", 38 39 // We are aware of the risks inherent in comparing floats for equality 40 "-Wno-float-equal", 41 42 // We use four-character constants for the GraphicBuffer header, and don't care 43 // that they're non-portable as long as they're consistent within one execution 44 "-Wno-four-char-constants", 45 46 // Don't warn about struct padding 47 "-Wno-padded", 48 49 "-Wno-switch-enum", 50 ], 51 52 sanitize: { 53 integer_overflow: true, 54 }, 55 56 srcs: [ 57 "ColorSpace.cpp", 58 "BufferHubBuffer.cpp", 59 "BufferHubEventFd.cpp", 60 "BufferHubMetadata.cpp", 61 "DebugUtils.cpp", 62 "Fence.cpp", 63 "FenceTime.cpp", 64 "FrameStats.cpp", 65 "Gralloc.cpp", 66 "Gralloc2.cpp", 67 "Gralloc3.cpp", 68 "GraphicBuffer.cpp", 69 "GraphicBufferAllocator.cpp", 70 "GraphicBufferMapper.cpp", 71 "HdrCapabilities.cpp", 72 "PixelFormat.cpp", 73 "PublicFormat.cpp", 74 "Rect.cpp", 75 "Region.cpp", 76 "Size.cpp", 77 "Transform.cpp", 78 "UiConfig.cpp", 79 ], 80 81 include_dirs: [ 82 "frameworks/native/include", 83 ], 84 85 // Uncomment the following line to enable VALIDATE_REGIONS traces 86 //defaults: ["libui-validate-regions-defaults"], 87 88 shared_libs: [ 89 "android.frameworks.bufferhub@1.0", 90 "android.hardware.graphics.allocator@2.0", 91 "android.hardware.graphics.allocator@3.0", 92 "android.hardware.graphics.common@1.2", 93 "android.hardware.graphics.mapper@2.0", 94 "android.hardware.graphics.mapper@2.1", 95 "android.hardware.graphics.mapper@3.0", 96 "libbase", 97 "libcutils", 98 "libhardware", 99 "libhidlbase", 100 "libhidltransport", 101 "libhwbinder", 102 "libsync", 103 "libutils", 104 "liblog", 105 ], 106 107 export_shared_lib_headers: [ 108 "android.hardware.graphics.common@1.2", 109 ], 110 111 static_libs: [ 112 "libarect", 113 "libgrallocusage", 114 "libmath", 115 ], 116 117 // bufferhub is not used when building libgui for vendors 118 target: { 119 vendor: { 120 cflags: ["-DLIBUI_IN_VNDK"], 121 exclude_srcs: [ 122 "BufferHubBuffer.cpp", 123 "BufferHubEventFd.cpp", 124 "BufferHubMetadata.cpp", 125 ], 126 exclude_header_libs: [ 127 "libbufferhub_headers", 128 "libdvr_headers", 129 ], 130 exclude_shared_libs: [ 131 "android.frameworks.bufferhub@1.0", 132 "libpdx_default_transport", 133 ], 134 }, 135 }, 136 137 header_libs: [ 138 "libbase_headers", 139 "libbufferhub_headers", 140 "libdvr_headers", 141 "libnativebase_headers", 142 "libnativewindow_headers", 143 "libhardware_headers", 144 "libui_headers", 145 "libpdx_headers", 146 ], 147 148 export_static_lib_headers: [ 149 "libarect", 150 "libmath", 151 ], 152 153 export_header_lib_headers: [ 154 "libbase_headers", 155 "libnativebase_headers", 156 "libnativewindow_headers", 157 "libhardware_headers", 158 "libui_headers", 159 ], 160} 161 162cc_library_headers { 163 name: "libui_headers", 164 export_include_dirs: ["include"], 165 vendor_available: true, 166 target: { 167 vendor: { 168 cflags: ["-DLIBUI_IN_VNDK"], 169 override_export_include_dirs: ["include_vndk"], 170 }, 171 }, 172 header_libs: [ 173 "libnativewindow_headers", 174 ], 175 export_header_lib_headers: [ 176 "libnativewindow_headers", 177 ], 178} 179 180// defaults to enable VALIDATE_REGIONS traces 181cc_defaults { 182 name: "libui-validate-regions-defaults", 183 shared_libs: ["libutilscallstack"], 184 cflags: ["-DVALIDATE_REGIONS"], 185} 186 187subdirs = [ 188 "tests", 189 "tools", 190] 191