OSDN Git Service

Avoid pulling libdrm.so from the AOSP host build
[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_library_host_shared {
89     name: "libgbm",
90     defaults: ["minigbm_defaults"],
91
92     srcs: [
93         "gbm.c",
94         "gbm_helpers.c",
95     ],
96
97     export_include_dirs: ["."],
98
99     // Avoid linking to another host copy of libdrm; this library will cause
100     // binary GPU drivers to be loaded from the host, which might be linked
101     // to a system copy of libdrm, which conflicts with the AOSP one
102     allow_undefined_symbols: true,
103     header_libs: ["libdrm"],
104 }
105
106 cc_library_static {
107     name: "libminigbm_gralloc",
108     defaults: ["minigbm_gralloc_defaults"],
109     shared_libs: ["liblog"],
110     static_libs: ["libdrm"],
111
112     export_include_dirs: ["."],
113 }
114
115 cc_library_shared {
116     name: "gralloc.minigbm",
117     defaults: ["minigbm_gralloc_defaults"],
118     srcs: ["cros_gralloc/gralloc0/gralloc0.cc"],
119 }
120
121 cc_library_shared {
122     name: "gralloc.minigbm_intel",
123     defaults: ["minigbm_gralloc_defaults"],
124     enabled: false,
125     arch: {
126         x86: {
127             enabled: true,
128         },
129         x86_64: {
130             enabled: true,
131         },
132     },
133     cflags: ["-DDRV_I915"],
134     srcs: ["cros_gralloc/gralloc0/gralloc0.cc"],
135 }
136
137 cc_library_shared {
138     name: "gralloc.minigbm_meson",
139     defaults: ["minigbm_gralloc_defaults"],
140     cflags: ["-DDRV_MESON"],
141     srcs: ["cros_gralloc/gralloc0/gralloc0.cc"],
142 }