Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 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 | |
| 15 | cc_library_shared { |
| 16 | name: "libui", |
Jiyong Park | ea8c878 | 2017-04-28 18:08:36 +0900 | [diff] [blame] | 17 | vendor_available: true, |
Justin Yun | 71d6c885 | 2017-07-24 15:19:45 +0900 | [diff] [blame] | 18 | vndk: { |
| 19 | enabled: true, |
| 20 | }, |
Jiyong Park | a75d3d6 | 2018-04-09 12:16:30 +0900 | [diff] [blame] | 21 | double_loadable: true, |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 22 | |
| 23 | clang: true, |
Chih-Hung Hsieh | d66be0a | 2017-10-05 13:51:32 -0700 | [diff] [blame] | 24 | cflags: [ |
| 25 | "-Wall", |
| 26 | "-Werror", |
| 27 | ], |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 28 | cppflags: [ |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 29 | "-Weverything", |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 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 | |
Dan Stoza | 71bded5 | 2016-10-19 11:10:33 -0700 | [diff] [blame] | 39 | // We are aware of the risks inherent in comparing floats for equality |
| 40 | "-Wno-float-equal", |
| 41 | |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 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", |
Jooyung Han | 419fb44 | 2019-02-21 15:02:58 +0900 | [diff] [blame] | 48 | |
| 49 | "-Wno-switch-enum", |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 50 | ], |
| 51 | |
| 52 | sanitize: { |
Ivan Lozano | 883bcce | 2017-09-25 10:26:18 -0700 | [diff] [blame] | 53 | integer_overflow: true, |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 54 | }, |
| 55 | |
| 56 | srcs: [ |
Romain Guy | caf2ca4 | 2016-11-10 11:45:58 -0800 | [diff] [blame] | 57 | "ColorSpace.cpp", |
Jiwen 'Steve' Cai | 8f51ec6 | 2018-08-07 21:50:51 -0700 | [diff] [blame] | 58 | "BufferHubBuffer.cpp", |
Tianyu Jiang | 99dacaa | 2018-11-27 18:47:00 -0800 | [diff] [blame] | 59 | "BufferHubEventFd.cpp", |
Jiwen 'Steve' Cai | 8f51ec6 | 2018-08-07 21:50:51 -0700 | [diff] [blame] | 60 | "BufferHubMetadata.cpp", |
Courtney Goeltzenleuchter | e06ad18 | 2017-03-22 13:09:12 -0600 | [diff] [blame] | 61 | "DebugUtils.cpp", |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 62 | "Fence.cpp", |
Brian Anderson | 221de2a | 2016-09-21 16:53:28 -0700 | [diff] [blame] | 63 | "FenceTime.cpp", |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 64 | "FrameStats.cpp", |
Marissa Wall | d380e2c | 2018-12-29 14:17:29 -0800 | [diff] [blame] | 65 | "Gralloc.cpp", |
Chia-I Wu | 5bac7f3 | 2017-04-06 12:34:32 -0700 | [diff] [blame] | 66 | "Gralloc2.cpp", |
Marissa Wall | 925bf7f | 2018-12-29 14:27:11 -0800 | [diff] [blame] | 67 | "Gralloc3.cpp", |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 68 | "GraphicBuffer.cpp", |
| 69 | "GraphicBufferAllocator.cpp", |
| 70 | "GraphicBufferMapper.cpp", |
| 71 | "HdrCapabilities.cpp", |
| 72 | "PixelFormat.cpp", |
Jooyung Han | 419fb44 | 2019-02-21 15:02:58 +0900 | [diff] [blame] | 73 | "PublicFormat.cpp", |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 74 | "Rect.cpp", |
| 75 | "Region.cpp", |
Lloyd Pique | 31cb294 | 2018-10-19 17:23:03 -0700 | [diff] [blame] | 76 | "Size.cpp", |
Peiyong Lin | efefaac | 2018-08-17 12:27:51 -0700 | [diff] [blame] | 77 | "Transform.cpp", |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 78 | "UiConfig.cpp", |
| 79 | ], |
| 80 | |
Jiyong Park | ea8c878 | 2017-04-28 18:08:36 +0900 | [diff] [blame] | 81 | include_dirs: [ |
| 82 | "frameworks/native/include", |
| 83 | ], |
| 84 | |
Chong Zhang | 639a1e1 | 2019-04-22 14:01:20 -0700 | [diff] [blame] | 85 | // Uncomment the following line to enable VALIDATE_REGIONS traces |
| 86 | //defaults: ["libui-validate-regions-defaults"], |
| 87 | |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 88 | shared_libs: [ |
Fan Xu | 021776e | 2018-12-05 13:34:48 -0800 | [diff] [blame] | 89 | "android.frameworks.bufferhub@1.0", |
Chia-I Wu | 9ba189d | 2016-09-22 17:13:08 +0800 | [diff] [blame] | 90 | "android.hardware.graphics.allocator@2.0", |
Marissa Wall | 925bf7f | 2018-12-29 14:27:11 -0800 | [diff] [blame] | 91 | "android.hardware.graphics.allocator@3.0", |
Valerie Hau | 9758ae0 | 2018-10-09 16:05:09 -0700 | [diff] [blame] | 92 | "android.hardware.graphics.common@1.2", |
Chia-I Wu | 3166947 | 2016-12-07 14:55:24 +0800 | [diff] [blame] | 93 | "android.hardware.graphics.mapper@2.0", |
Chia-I Wu | dbbe33b | 2017-09-27 15:22:21 -0700 | [diff] [blame] | 94 | "android.hardware.graphics.mapper@2.1", |
Marissa Wall | 925bf7f | 2018-12-29 14:27:11 -0800 | [diff] [blame] | 95 | "android.hardware.graphics.mapper@3.0", |
Courtney Goeltzenleuchter | e06ad18 | 2017-03-22 13:09:12 -0600 | [diff] [blame] | 96 | "libbase", |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 97 | "libcutils", |
Yifan Hong | 67a4762 | 2016-11-17 13:02:06 -0800 | [diff] [blame] | 98 | "libhidlbase", |
| 99 | "libhidltransport", |
Chia-I Wu | d8091b9 | 2017-05-16 14:30:34 -0700 | [diff] [blame] | 100 | "libhwbinder", |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 101 | "libsync", |
| 102 | "libutils", |
| 103 | "liblog", |
| 104 | ], |
Mathias Agopian | a934764 | 2017-02-13 16:42:28 -0800 | [diff] [blame] | 105 | |
Steven Moreland | 23aa5b1 | 2018-04-04 22:47:04 -0700 | [diff] [blame] | 106 | export_shared_lib_headers: [ |
Valerie Hau | 9758ae0 | 2018-10-09 16:05:09 -0700 | [diff] [blame] | 107 | "android.hardware.graphics.common@1.2", |
Steven Moreland | 23aa5b1 | 2018-04-04 22:47:04 -0700 | [diff] [blame] | 108 | ], |
| 109 | |
Mathias Agopian | a934764 | 2017-02-13 16:42:28 -0800 | [diff] [blame] | 110 | static_libs: [ |
| 111 | "libarect", |
Jesse Hall | 7992781 | 2017-03-23 11:03:23 -0700 | [diff] [blame] | 112 | "libgrallocusage", |
Mathias Agopian | 1d77b71 | 2017-02-17 15:46:13 -0800 | [diff] [blame] | 113 | "libmath", |
Mathias Agopian | a934764 | 2017-02-13 16:42:28 -0800 | [diff] [blame] | 114 | ], |
| 115 | |
Jiwen 'Steve' Cai | 8f51ec6 | 2018-08-07 21:50:51 -0700 | [diff] [blame] | 116 | // bufferhub is not used when building libgui for vendors |
| 117 | target: { |
| 118 | vendor: { |
Jiwen 'Steve' Cai | 2daf518 | 2018-10-16 00:14:03 -0700 | [diff] [blame] | 119 | cflags: ["-DLIBUI_IN_VNDK"], |
Jiwen 'Steve' Cai | 8f51ec6 | 2018-08-07 21:50:51 -0700 | [diff] [blame] | 120 | exclude_srcs: [ |
| 121 | "BufferHubBuffer.cpp", |
Tianyu Jiang | 99dacaa | 2018-11-27 18:47:00 -0800 | [diff] [blame] | 122 | "BufferHubEventFd.cpp", |
Jiwen 'Steve' Cai | 8f51ec6 | 2018-08-07 21:50:51 -0700 | [diff] [blame] | 123 | "BufferHubMetadata.cpp", |
| 124 | ], |
| 125 | exclude_header_libs: [ |
| 126 | "libbufferhub_headers", |
| 127 | "libdvr_headers", |
| 128 | ], |
| 129 | exclude_shared_libs: [ |
Fan Xu | 021776e | 2018-12-05 13:34:48 -0800 | [diff] [blame] | 130 | "android.frameworks.bufferhub@1.0", |
Jiwen 'Steve' Cai | 8f51ec6 | 2018-08-07 21:50:51 -0700 | [diff] [blame] | 131 | "libpdx_default_transport", |
| 132 | ], |
| 133 | }, |
| 134 | }, |
| 135 | |
Mathias Agopian | 6a3c05b | 2017-04-27 20:06:55 -0700 | [diff] [blame] | 136 | header_libs: [ |
Chia-I Wu | df1badd | 2017-12-27 11:10:20 -0800 | [diff] [blame] | 137 | "libbase_headers", |
Jiwen 'Steve' Cai | 8f51ec6 | 2018-08-07 21:50:51 -0700 | [diff] [blame] | 138 | "libbufferhub_headers", |
| 139 | "libdvr_headers", |
Mathias Agopian | 6a3c05b | 2017-04-27 20:06:55 -0700 | [diff] [blame] | 140 | "libnativebase_headers", |
Jiwen 'Steve' Cai | 2daf518 | 2018-10-16 00:14:03 -0700 | [diff] [blame] | 141 | "libnativewindow_headers", |
Jiyong Park | 172bd72 | 2017-06-21 12:14:18 +0900 | [diff] [blame] | 142 | "libhardware_headers", |
Jiwen 'Steve' Cai | 44addfe | 2018-03-13 21:37:11 -0700 | [diff] [blame] | 143 | "libui_headers", |
Jiyong Park | a75d3d6 | 2018-04-09 12:16:30 +0900 | [diff] [blame] | 144 | "libpdx_headers", |
Mathias Agopian | 6a3c05b | 2017-04-27 20:06:55 -0700 | [diff] [blame] | 145 | ], |
| 146 | |
Mathias Agopian | 1d77b71 | 2017-02-17 15:46:13 -0800 | [diff] [blame] | 147 | export_static_lib_headers: [ |
| 148 | "libarect", |
| 149 | "libmath", |
| 150 | ], |
Mathias Agopian | 6a3c05b | 2017-04-27 20:06:55 -0700 | [diff] [blame] | 151 | |
| 152 | export_header_lib_headers: [ |
Chia-I Wu | df1badd | 2017-12-27 11:10:20 -0800 | [diff] [blame] | 153 | "libbase_headers", |
Mathias Agopian | 6a3c05b | 2017-04-27 20:06:55 -0700 | [diff] [blame] | 154 | "libnativebase_headers", |
Pawin Vongmasa | e672cd0 | 2019-02-14 16:01:29 -0800 | [diff] [blame] | 155 | "libnativewindow_headers", |
Jiyong Park | 172bd72 | 2017-06-21 12:14:18 +0900 | [diff] [blame] | 156 | "libhardware_headers", |
Jiwen 'Steve' Cai | 44addfe | 2018-03-13 21:37:11 -0700 | [diff] [blame] | 157 | "libui_headers", |
Mathias Agopian | 6a3c05b | 2017-04-27 20:06:55 -0700 | [diff] [blame] | 158 | ], |
Dan Willemsen | c7dd2b9 | 2016-08-25 17:05:22 -0700 | [diff] [blame] | 159 | } |
| 160 | |
Isaac Chen | 8d1349a | 2017-08-31 19:05:25 +0800 | [diff] [blame] | 161 | cc_library_headers { |
| 162 | name: "libui_headers", |
| 163 | export_include_dirs: ["include"], |
| 164 | vendor_available: true, |
Jiwen 'Steve' Cai | 781a6f0 | 2018-04-02 11:55:54 -0700 | [diff] [blame] | 165 | target: { |
| 166 | vendor: { |
Jiwen 'Steve' Cai | 2daf518 | 2018-10-16 00:14:03 -0700 | [diff] [blame] | 167 | cflags: ["-DLIBUI_IN_VNDK"], |
Jiwen 'Steve' Cai | 781a6f0 | 2018-04-02 11:55:54 -0700 | [diff] [blame] | 168 | override_export_include_dirs: ["include_vndk"], |
| 169 | }, |
| 170 | }, |
Pawin Vongmasa | 6648e0d | 2019-03-22 08:18:38 -0700 | [diff] [blame] | 171 | header_libs: [ |
| 172 | "libnativewindow_headers", |
| 173 | ], |
| 174 | export_header_lib_headers: [ |
| 175 | "libnativewindow_headers", |
| 176 | ], |
Isaac Chen | 8d1349a | 2017-08-31 19:05:25 +0800 | [diff] [blame] | 177 | } |
| 178 | |
Chong Zhang | 639a1e1 | 2019-04-22 14:01:20 -0700 | [diff] [blame] | 179 | // defaults to enable VALIDATE_REGIONS traces |
| 180 | cc_defaults { |
| 181 | name: "libui-validate-regions-defaults", |
| 182 | shared_libs: ["libutilscallstack"], |
| 183 | cflags: ["-DVALIDATE_REGIONS"], |
| 184 | } |
| 185 | |
Jeff Gaston | 927acf7 | 2017-10-10 14:22:08 -0700 | [diff] [blame] | 186 | subdirs = [ |
| 187 | "tests", |
| 188 | "tools", |
| 189 | ] |
Fedor Kudasov | 3627207 | 2019-07-04 12:53:57 +0100 | [diff] [blame] | 190 | |
| 191 | filegroup { |
| 192 | name: "libui_host_common", |
| 193 | srcs: [ |
| 194 | "Rect.cpp", |
| 195 | "PixelFormat.cpp" |
| 196 | ], |
| 197 | } |