OSDN Git Service

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