1 // Copyright 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 cc_library_headers { 15 name: "libgui_headers", 16 vendor_available: true, 17 export_include_dirs: ["include"], 18 } 19 20 cc_library_shared { 21 name: "libgui", 22 vendor_available: false, 23 vndk: { 24 enabled: true, 25 }, 26 27 clang: true, 28 cflags: [ 29 "-Wall", 30 "-Werror", 31 ], 32 cppflags: [ 33 "-Weverything", 34 35 // The static constructors and destructors in this library have not been noted to 36 // introduce significant overheads 37 "-Wno-exit-time-destructors", 38 "-Wno-global-constructors", 39 40 // We only care about compiling as C++14 41 "-Wno-c++98-compat-pedantic", 42 43 // We don't need to enumerate every case in a switch as long as a default case 44 // is present 45 "-Wno-switch-enum", 46 47 // Allow calling variadic macros without a __VA_ARGS__ list 48 "-Wno-gnu-zero-variadic-macro-arguments", 49 50 // Don't warn about struct padding 51 "-Wno-padded", 52 53 // We are aware of the risks inherent in comparing floats for equality 54 "-Wno-float-equal", 55 56 // Pure abstract classes trigger this warning 57 "-Wno-weak-vtables", 58 59 // Allow four-character integer literals 60 "-Wno-four-char-constants", 61 62 // Allow documentation warnings 63 "-Wno-documentation", 64 65 // Allow implicit instantiation for templated class function 66 "-Wno-undefined-func-template", 67 68 // Allow explicitly marking struct as packed even when unnecessary 69 "-Wno-packed", 70 71 "-DDEBUG_ONLY_CODE=0", 72 ], 73 74 product_variables: { 75 brillo: { 76 cflags: ["-DHAVE_NO_SURFACE_FLINGER"], 77 }, 78 eng: { 79 cppflags: [ 80 "-UDEBUG_ONLY_CODE", 81 "-DDEBUG_ONLY_CODE=1", 82 ], 83 }, 84 }, 85 86 srcs: [ 87 "BitTube.cpp", 88 "BufferHubConsumer.cpp", 89 "BufferHubProducer.cpp", 90 "BufferItem.cpp", 91 "BufferItemConsumer.cpp", 92 "BufferQueue.cpp", 93 "BufferQueueConsumer.cpp", 94 "BufferQueueCore.cpp", 95 "BufferQueueProducer.cpp", 96 "BufferSlot.cpp", 97 "ConsumerBase.cpp", 98 "CpuConsumer.cpp", 99 "DisplayEventReceiver.cpp", 100 "FrameTimestamps.cpp", 101 "GLConsumer.cpp", 102 "GuiConfig.cpp", 103 "HdrMetadata.cpp", 104 "IDisplayEventConnection.cpp", 105 "IConsumerListener.cpp", 106 "IGraphicBufferConsumer.cpp", 107 "IGraphicBufferProducer.cpp", 108 "IProducerListener.cpp", 109 "ISurfaceComposer.cpp", 110 "ISurfaceComposerClient.cpp", 111 "LayerDebugInfo.cpp", 112 "LayerState.cpp", 113 "OccupancyTracker.cpp", 114 "StreamSplitter.cpp", 115 "Surface.cpp", 116 "SurfaceControl.cpp", 117 "SurfaceComposerClient.cpp", 118 "SyncFeatures.cpp", 119 "view/Surface.cpp", 120 "bufferqueue/1.0/B2HProducerListener.cpp", 121 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp" 122 ], 123 124 shared_libs: [ 125 "android.hardware.graphics.common (a] 1.1", 126 "libsync", 127 "libbinder", 128 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui. 129 "libpdx_default_transport", 130 "libcutils", 131 "libEGL", 132 "libGLESv2", 133 "libui", 134 "libutils", 135 "libnativewindow", 136 "liblog", 137 "libhidlbase", 138 "libhidltransport", 139 "android.hidl.token (a] 1.0-utils", 140 "android.hardware.graphics.bufferqueue (a] 1.0", 141 "android.hardware.configstore (a] 1.0", 142 "android.hardware.configstore-utils", 143 ], 144 145 // bufferhub is not used when building libgui for vendors 146 target: { 147 vendor: { 148 cflags: ["-DNO_BUFFERHUB"], 149 exclude_srcs: [ 150 "BufferHubConsumer.cpp", 151 "BufferHubProducer.cpp", 152 ], 153 exclude_shared_libs: [ 154 "libbufferhubqueue", 155 "libpdx_default_transport", 156 ], 157 }, 158 }, 159 160 header_libs: [ 161 "libdvr_headers", 162 "libnativebase_headers", 163 "libgui_headers", 164 "libpdx_headers", 165 ], 166 167 export_shared_lib_headers: [ 168 "libbinder", 169 "libEGL", 170 "libnativewindow", 171 "libui", 172 "android.hidl.token (a] 1.0-utils", 173 "android.hardware.graphics.bufferqueue (a] 1.0", 174 "android.hardware.graphics.common (a] 1.1", 175 ], 176 177 export_header_lib_headers: [ 178 "libgui_headers", 179 ], 180 181 export_include_dirs: [ 182 "include", 183 ], 184 } 185 186 subdirs = ["tests"] 187