• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
15package {
16    default_applicable_licenses: ["frameworks_native_libs_ui_license"],
17    default_team: "trendy_team_android_core_graphics_stack",
18}
19
20// Added automatically by a large-scale-change
21// See: http://go/android-license-faq
22license {
23    name: "frameworks_native_libs_ui_license",
24    visibility: [":__subpackages__"],
25    license_kinds: [
26        "SPDX-license-identifier-Apache-2.0",
27    ],
28    license_text: [
29        "NOTICE",
30    ],
31}
32
33cc_library_headers {
34    name: "libui_fuzzableDataspaces_headers",
35    export_include_dirs: ["include/ui/fuzzer/"],
36}
37
38cc_defaults {
39    name: "libui-defaults",
40    cflags: [
41        "-Wall",
42        "-Werror",
43    ],
44    cppflags: [
45        "-Wextra",
46    ],
47
48    sanitize: {
49        integer_overflow: true,
50        misc_undefined: ["bounds"],
51    },
52}
53
54cc_library_static {
55    name: "libui-types",
56    vendor_available: true,
57    host_supported: true,
58    target: {
59        windows: {
60            enabled: true,
61        },
62    },
63
64    defaults: [
65        "libui-defaults",
66    ],
67
68    apex_available: [
69        "//apex_available:anyapex",
70        "//apex_available:platform",
71    ],
72    min_sdk_version: "apex_inherit",
73
74    shared_libs: [
75        "libbase",
76        "libutils",
77    ],
78
79    static_libs: [
80        "libarect",
81        "libmath",
82    ],
83
84    srcs: [
85        "ColorSpace.cpp",
86        "Rect.cpp",
87        "Region.cpp",
88        "Transform.cpp",
89    ],
90
91    export_include_dirs: [
92        "include",
93        "include_mock",
94        "include_private",
95        "include_types",
96    ],
97
98    export_static_lib_headers: [
99        "libarect",
100        "libmath",
101    ],
102
103}
104
105cc_library_shared {
106    name: "libui",
107    vendor_available: true,
108    double_loadable: true,
109
110    cflags: [
111        "-Wall",
112        "-Werror",
113    ],
114    cppflags: [
115        "-Wextra",
116    ],
117
118    sanitize: {
119        integer_overflow: true,
120        misc_undefined: ["bounds"],
121    },
122
123    srcs: [
124        "DebugUtils.cpp",
125        "DeviceProductInfo.cpp",
126        "DisplayIdentification.cpp",
127        "DynamicDisplayInfo.cpp",
128        "Fence.cpp",
129        "FenceTime.cpp",
130        "FrameStats.cpp",
131        "Gralloc.cpp",
132        "Gralloc2.cpp",
133        "Gralloc3.cpp",
134        "Gralloc4.cpp",
135        "Gralloc5.cpp",
136        "GraphicBuffer.cpp",
137        "GraphicBufferAllocator.cpp",
138        "GraphicBufferMapper.cpp",
139        "PixelFormat.cpp",
140        "PublicFormat.cpp",
141        "StaticAsserts.cpp",
142    ],
143
144    include_dirs: [
145        "frameworks/native/include",
146    ],
147    export_include_dirs: [
148        "include",
149        "include_private",
150    ],
151
152    defaults: [
153        "android.hardware.graphics.allocator-ndk_shared",
154        "android.hardware.graphics.common-ndk_shared",
155        "libui-defaults",
156        // Uncomment the following line to enable VALIDATE_REGIONS traces
157        //defaults: ["libui-validate-regions-defaults"],
158    ],
159
160    shared_libs: [
161        "android.hardware.graphics.allocator@2.0",
162        "android.hardware.graphics.allocator@3.0",
163        "android.hardware.graphics.allocator@4.0",
164        "android.hardware.graphics.common@1.2",
165        "android.hardware.graphics.mapper@2.0",
166        "android.hardware.graphics.mapper@2.1",
167        "android.hardware.graphics.mapper@3.0",
168        "android.hardware.graphics.mapper@4.0",
169        "libbase",
170        "libbinder_ndk",
171        "libcutils",
172        "libgralloctypes",
173        "libhidlbase",
174        "libsync",
175        "libutils",
176        "liblog",
177        "libvndksupport",
178    ],
179
180    export_shared_lib_headers: [
181        "android.hardware.graphics.common@1.2",
182        "android.hardware.graphics.mapper@4.0",
183        "libgralloctypes",
184    ],
185
186    static_libs: [
187        "libaidlcommonsupport",
188        "libarect",
189        "libgrallocusage",
190        "libmath",
191    ],
192
193    whole_static_libs: [
194        "libui-types",
195    ],
196
197    // bufferhub is not used when building libgui for vendors
198    target: {
199        vendor: {
200            cflags: ["-DLIBUI_IN_VNDK"],
201            exclude_srcs: [
202            ],
203            exclude_header_libs: [
204            ],
205            exclude_shared_libs: [
206            ],
207        },
208    },
209
210    header_libs: [
211        "libbase_headers",
212        "libnativebase_headers",
213        "libnativewindow_headers",
214        "libhardware_headers",
215        "libui_headers",
216        "libimapper_stablec",
217        "libimapper_providerutils",
218    ],
219
220    export_static_lib_headers: [
221        "libarect",
222        "libmath",
223    ],
224
225    export_header_lib_headers: [
226        "libbase_headers",
227        "libnativebase_headers",
228        "libnativewindow_headers",
229        "libhardware_headers",
230        "libui_headers",
231    ],
232    min_sdk_version: "29",
233    // TODO(b/214400477) to remove use of GraphicBuffer
234    apex_available: [
235        "//apex_available:platform",
236        "com.android.media.swcodec",
237        "test_com.android.media.swcodec",
238    ],
239
240    afdo: true,
241}
242
243cc_library_headers {
244    name: "libui_headers",
245    export_include_dirs: ["include"],
246    vendor_available: true,
247    target: {
248        vendor: {
249            cflags: ["-DLIBUI_IN_VNDK"],
250            override_export_include_dirs: ["include_vndk"],
251        },
252    },
253    header_libs: [
254        "libnativewindow_headers",
255        "libmath_headers",
256    ],
257    export_header_lib_headers: [
258        "libnativewindow_headers",
259        "libmath_headers",
260    ],
261    min_sdk_version: "29",
262    apex_available: [
263        "//apex_available:platform",
264        "com.android.media.swcodec",
265        "test_com.android.media.swcodec",
266    ],
267}
268
269// defaults to enable VALIDATE_REGIONS traces
270cc_defaults {
271    name: "libui-validate-regions-defaults",
272    shared_libs: ["libutilscallstack"],
273    cflags: ["-DVALIDATE_REGIONS"],
274}
275
276subdirs = [
277    "tests",
278    "tools",
279]
280