blob: f03d8de5194dbc13f8161166b9e785b9c40eff46 [file] [log] [blame]
Frederick Mayle769e04f2022-04-08 17:43:37 +00001diff --git b/gpu_display/Android.bp a/gpu_display/Android.bp
2--- b/gpu_display/Android.bp
3+++ a/gpu_display/Android.bp
4@@ -32,7 +32,116 @@ rust_library {
5 "liblinux_input_sys",
6 "libthiserror",
7 ],
8 proc_macros: ["libremain"],
9 static_libs: ["libdisplay_wl"],
10- shared_libs: ["libwayland-client"],
11+
12+ // added manually
13+ target: {
14+ host: {
15+ shared_libs: ["libwayland_client"],
16+ },
17+ android: {
18+ static_libs: [
19+ "libwayland_client_static",
20+ "libffi",
21+ ],
22+ },
23+ },
24+}
25+
26+cc_library_static {
27+ name: "libdisplay_wl",
28+ host_supported: true,
29+ c_std: "c11",
30+ srcs: ["src/display_wl.c"],
31+
32+ generated_sources: [
33+ "gpu_display_protocol_sources",
34+ "wayland_extension_protocol_sources",
35+ ],
36+ generated_headers: [
37+ "gpu_display_client_protocol_headers",
38+ "wayland_extension_client_protocol_headers",
39+ ],
40+ export_generated_headers: [
41+ "gpu_display_client_protocol_headers",
42+ "wayland_extension_client_protocol_headers",
43+ ],
44+
45+ // added manually
46+ target: {
47+ host: {
48+ shared_libs: ["libwayland_client"],
49+ },
50+ android: {
51+ static_libs: [
52+ "libwayland_client_static",
53+ "libffi",
54+ ],
55+ },
56+ linux_glibc_x86: {
57+ // libffi broken on x86, see b/162610242
58+ enabled: false,
59+ },
60+ },
61+ apex_available: [
62+ "//apex_available:platform",
63+ "com.android.virt",
64+ ],
65+}
66+
67+wayland_protocol_codegen {
68+ name: "gpu_display_protocol_sources",
69+ cmd: "$(location wayland_scanner) private-code < $(in) > $(out)",
70+ suffix: ".c",
71+ srcs: [
72+ "protocol/aura-shell.xml",
73+ "protocol/linux-dmabuf-unstable-v1.xml",
74+ "protocol/viewporter.xml",
75+ "protocol/virtio-gpu-metadata-v1.xml",
76+ ],
77+ tools: ["wayland_scanner"],
78+}
79+
80+wayland_protocol_codegen {
81+ name: "gpu_display_client_protocol_headers",
82+ cmd: "$(location wayland_scanner) client-header < $(in) > $(out)",
83+ suffix: ".h",
84+ srcs: [
85+ "protocol/aura-shell.xml",
86+ "protocol/linux-dmabuf-unstable-v1.xml",
87+ "protocol/viewporter.xml",
88+ "protocol/virtio-gpu-metadata-v1.xml",
89+ ],
90+ tools: ["wayland_scanner"],
91+}
92+
93+wayland_protocol_codegen {
94+ name: "gpu_display_server_protocol_headers",
95+ cmd: "$(location wayland_scanner) server-header < $(in) > $(out)",
96+ suffix: ".h",
97+ srcs: [
98+ "protocol/aura-shell.xml",
99+ "protocol/linux-dmabuf-unstable-v1.xml",
100+ "protocol/viewporter.xml",
101+ "protocol/virtio-gpu-metadata-v1.xml",
102+ ],
103+ tools: ["wayland_scanner"],
104+}
105+
106+cc_library_static {
107+ name: "libwayland_crosvm_gpu_display_extension_server_protocols",
108+ vendor_available: true,
109+ host_supported: true,
110+ cflags: [
111+ "-Wall",
112+ "-Wextra",
113+ "-Werror",
114+ "-g",
115+ "-fvisibility=hidden",
116+ ],
117+ static_libs: ["libwayland_server"],
118+ generated_sources: ["gpu_display_protocol_sources"],
119+ generated_headers: ["gpu_display_server_protocol_headers"],
120+ export_generated_headers: ["gpu_display_server_protocol_headers"],
121 }