OSDN Git Service

ANDROID: Add target/device support
[android-x86/external-minigbm.git] / Android.bp
1 /*
2  * Copyright 2020 The Chromium OS Authors. All rights reserved.
3  * Use of this source code is governed by a BSD-style license that can be
4  * found in the LICENSE file.
5  */
6
7 cc_defaults {
8     name: "minigbm_defaults",
9
10     srcs: [
11         "amdgpu.c",
12         "drv.c",
13         "evdi.c",
14         "exynos.c",
15         "helpers_array.c",
16         "helpers.c",
17         "i915.c",
18         "marvell.c",
19         "mediatek.c",
20         "meson.c",
21         "msm.c",
22         "nouveau.c",
23         "radeon.c",
24         "rockchip.c",
25         "tegra.c",
26         "udl.c",
27         "vc4.c",
28         "vgem.c",
29         "virtio_gpu.c",
30     ],
31
32     cflags: [
33         "-D_GNU_SOURCE=1",
34         "-D_FILE_OFFSET_BITS=64",
35         "-Wall",
36         "-Wsign-compare",
37         "-Wpointer-arith",
38         "-Wcast-qual",
39         "-Wcast-align",
40         "-Wno-unused-parameter",
41     ],
42
43     cppflags: ["-std=c++14"],
44 }
45
46 cc_defaults {
47     name: "minigbm_gralloc_defaults",
48
49     defaults: ["minigbm_defaults"],
50
51     header_libs: [
52         "libhardware_headers",
53         "libnativebase_headers",
54         "libnativewindow_headers",
55         "libsystem_headers",
56     ],
57
58     export_header_lib_headers: [
59         "libhardware_headers",
60         "libnativebase_headers",
61         "libnativewindow_headers",
62         "libsystem_headers",
63     ],
64
65     srcs: [
66         "cros_gralloc/cros_gralloc_buffer.cc",
67         "cros_gralloc/cros_gralloc_helpers.cc",
68         "cros_gralloc/cros_gralloc_driver.cc",
69     ],
70
71     static_libs: ["libarect"],
72
73     export_static_lib_headers: ["libarect"],
74
75     vendor: true,
76
77     shared_libs: [
78         "libcutils",
79         "libdrm",
80         "libnativewindow",
81         "libsync",
82         "liblog",
83     ],
84
85     relative_install_path: "hw",
86 }
87
88 cc_defaults {
89     name: "gbm_defaults",
90
91     defaults: ["minigbm_defaults"],
92
93     srcs: [
94         "gbm.c",
95         "gbm_helpers.c",
96     ],
97
98     export_include_dirs: ["."],
99 }
100
101 cc_library {
102     name: "libgbm",
103     defaults: ["gbm_defaults"],
104     host_supported: true,
105
106     target: {
107         host: {
108             // Avoid linking to another host copy of libdrm; this library will cause
109             // binary GPU drivers to be loaded from the host, which might be linked
110             // to a system copy of libdrm, which conflicts with the AOSP one
111             allow_undefined_symbols: true,
112             header_libs: ["libdrm"],
113         },
114         android: {
115             shared_libs: [
116                 "libdrm",
117                 "liblog"
118             ],
119         },
120     },
121 }
122
123 cc_library_static {
124     name: "libminigbm_gralloc",
125     defaults: ["minigbm_gralloc_defaults"],
126     shared_libs: ["liblog"],
127     static_libs: ["libdrm"],
128
129     export_include_dirs: ["."],
130 }
131
132 cc_library_shared {
133     name: "gralloc.minigbm",
134     defaults: ["minigbm_gralloc_defaults"],
135     srcs: ["cros_gralloc/gralloc0/gralloc0.cc"],
136 }
137
138 cc_library_shared {
139     name: "gralloc.minigbm_intel",
140     defaults: ["minigbm_gralloc_defaults"],
141     enabled: false,
142     arch: {
143         x86: {
144             enabled: true,
145         },
146         x86_64: {
147             enabled: true,
148         },
149     },
150     cflags: ["-DDRV_I915"],
151     srcs: ["cros_gralloc/gralloc0/gralloc0.cc"],
152 }
153
154 cc_library_shared {
155     name: "gralloc.minigbm_meson",
156     defaults: ["minigbm_gralloc_defaults"],
157     cflags: ["-DDRV_MESON"],
158     srcs: ["cros_gralloc/gralloc0/gralloc0.cc"],
159 }