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        "-Wextra",
30    ],
31
32    sanitize: {
33        integer_overflow: true,
34        misc_undefined: ["bounds"],
35    },
36
37    srcs: [
38        "ColorSpace.cpp",
39        "DebugUtils.cpp",
40        "Fence.cpp",
41        "FenceTime.cpp",
42        "FrameStats.cpp",
43        "Gralloc.cpp",
44        "Gralloc2.cpp",
45        "Gralloc3.cpp",
46        "Gralloc4.cpp",
47        "GraphicBuffer.cpp",
48        "GraphicBufferAllocator.cpp",
49        "GraphicBufferMapper.cpp",
50        "HdrCapabilities.cpp",
51        "PixelFormat.cpp",
52        "PublicFormat.cpp",
53        "Rect.cpp",
54        "Region.cpp",
55        "Size.cpp",
56        "Transform.cpp",
57        "UiConfig.cpp",
58    ],
59
60    include_dirs: [
61        "frameworks/native/include",
62    ],
63    export_include_dirs: [
64        "include",
65        "include_private",
66    ],
67
68    // Uncomment the following line to enable VALIDATE_REGIONS traces
69    //defaults: ["libui-validate-regions-defaults"],
70
71    shared_libs: [
72        "android.hardware.graphics.allocator@2.0",
73        "android.hardware.graphics.allocator@3.0",
74        "android.hardware.graphics.allocator@4.0",
75        "android.hardware.graphics.common-ndk_platform",
76        "android.hardware.graphics.common@1.2",
77        "android.hardware.graphics.mapper@2.0",
78        "android.hardware.graphics.mapper@2.1",
79        "android.hardware.graphics.mapper@3.0",
80        "android.hardware.graphics.mapper@4.0",
81        "libbase",
82        "libcutils",
83        "libgralloctypes",
84        "libhidlbase",
85        "libsync",
86        "libutils",
87        "liblog",
88    ],
89
90    export_shared_lib_headers: [
91        "android.hardware.graphics.common@1.2",
92        "android.hardware.graphics.common-ndk_platform",
93        "android.hardware.graphics.mapper@4.0",
94        "libgralloctypes",
95    ],
96
97    static_libs: [
98        "libarect",
99        "libgrallocusage",
100        "libmath",
101    ],
102
103    // bufferhub is not used when building libgui for vendors
104    target: {
105        vendor: {
106            cflags: ["-DLIBUI_IN_VNDK"],
107            exclude_srcs: [
108            ],
109            exclude_header_libs: [
110            ],
111            exclude_shared_libs: [
112            ],
113        },
114    },
115
116    header_libs: [
117        "libbase_headers",
118        "libnativebase_headers",
119        "libnativewindow_headers",
120        "libhardware_headers",
121        "libui_headers",
122    ],
123
124    export_static_lib_headers: [
125        "libarect",
126        "libmath",
127    ],
128
129    export_header_lib_headers: [
130        "libbase_headers",
131        "libnativebase_headers",
132        "libnativewindow_headers",
133        "libhardware_headers",
134        "libui_headers",
135    ],
136    min_sdk_version: "29",
137}
138
139cc_library_headers {
140    name: "libui_headers",
141    export_include_dirs: ["include"],
142    vendor_available: true,
143    target: {
144        vendor: {
145            cflags: ["-DLIBUI_IN_VNDK"],
146            override_export_include_dirs: ["include_vndk"],
147        },
148    },
149    header_libs: [
150        "libnativewindow_headers",
151    ],
152    export_header_lib_headers: [
153        "libnativewindow_headers",
154    ],
155    min_sdk_version: "29",
156}
157
158// defaults to enable VALIDATE_REGIONS traces
159cc_defaults {
160    name: "libui-validate-regions-defaults",
161    shared_libs: ["libutilscallstack"],
162    cflags: ["-DVALIDATE_REGIONS"],
163}
164
165subdirs = [
166    "tests",
167    "tools",
168]
169
170filegroup {
171    name: "libui_host_common",
172    srcs: [
173        "Rect.cpp",
174        "PixelFormat.cpp"
175    ],
176}
177