• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// This file is generated by cargo_embargo.
2// Do not modify this file as changes will be overridden on upgrade.
3
4// cargo2android.py limitations:
5//   does not handle "-l dylib=wayland-client" yet
6//   does not generate cc_library module yet
7//   does not generate wayland_protocol_codegen module yet
8
9package {
10    // See: http://go/android-license-faq
11    // A large-scale-change added 'default_applicable_licenses' to import
12    // all of the 'license_kinds' from "external_crosvm_license"
13    // to get the below license kinds:
14    //   SPDX-license-identifier-BSD
15    //   SPDX-license-identifier-MIT
16    default_applicable_licenses: ["external_crosvm_license"],
17}
18
19rust_library {
20    name: "libgpu_display",
21    defaults: ["crosvm_inner_defaults"],
22    host_supported: true,
23    crate_name: "gpu_display",
24    cargo_env_compat: true,
25    cargo_pkg_version: "0.1.0",
26    srcs: ["src/lib.rs"],
27    edition: "2021",
28    rustlibs: [
29        "libanyhow",
30        "libbase_rust",
31        "libcfg_if",
32        "libdata_model",
33        "liblibc",
34        "liblinux_input_sys",
35        "libserde",
36        "libthiserror",
37        "libzerocopy",
38    ],
39    proc_macros: ["libremain"],
40    static_libs: ["libdisplay_wl"],
41
42    // added manually
43    target: {
44        host: {
45            shared_libs: ["libwayland_client"],
46        },
47        android: {
48            static_libs: [
49                "libwayland_client_static",
50                "libffi",
51            ],
52        },
53    },
54}
55
56cc_library_static {
57    name: "libdisplay_wl",
58    host_supported: true,
59    c_std: "c11",
60    srcs: ["src/display_wl.c"],
61
62    generated_sources: [
63        "gpu_display_protocol_sources",
64        "wayland_extension_protocol_sources",
65    ],
66    generated_headers: [
67        "gpu_display_client_protocol_headers",
68    ],
69    export_generated_headers: [
70        "gpu_display_client_protocol_headers",
71    ],
72
73    // added manually
74    target: {
75        host: {
76            shared_libs: ["libwayland_client"],
77        },
78        android: {
79            static_libs: [
80                "libwayland_client_static",
81                "libffi",
82            ],
83        },
84    },
85    apex_available: [
86        "//apex_available:platform",
87        "com.android.virt",
88    ],
89}
90
91// We could use the modules provided in //external/wayland-protocols, except
92//
93//  1. virtio-gpu-metadata-v1.xml is missing
94//  2. crosvm expects a different header suffix
95
96wayland_protocol_codegen {
97    name: "gpu_display_protocol_sources",
98    cmd: "$(location wayland_scanner) private-code < $(in) > $(out)",
99    suffix: ".c",
100    srcs: [
101        ":wayland_extension_protocols",
102        "protocol/virtio-gpu-metadata-v1.xml",
103    ],
104    tools: ["wayland_scanner"],
105}
106
107wayland_protocol_codegen {
108    name: "gpu_display_client_protocol_headers",
109    cmd: "$(location wayland_scanner) client-header < $(in) > $(out)",
110    suffix: ".h",
111    srcs: [
112        ":wayland_extension_protocols",
113        "protocol/virtio-gpu-metadata-v1.xml",
114    ],
115    tools: ["wayland_scanner"],
116}
117
118wayland_protocol_codegen {
119    name: "gpu_display_server_protocol_headers",
120    cmd: "$(location wayland_scanner) server-header < $(in) > $(out)",
121    suffix: ".h",
122    srcs: [
123        ":wayland_extension_protocols",
124        "protocol/virtio-gpu-metadata-v1.xml",
125    ],
126    tools: ["wayland_scanner"],
127}
128
129cc_library_static {
130    name: "libwayland_crosvm_gpu_display_extension_server_protocols",
131    vendor_available: true,
132    host_supported: true,
133    cflags: [
134        "-Wall",
135        "-Wextra",
136        "-Werror",
137        "-g",
138        "-fvisibility=hidden",
139    ],
140    static_libs: ["libwayland_server"],
141    generated_sources: ["gpu_display_protocol_sources"],
142    generated_headers: ["gpu_display_server_protocol_headers"],
143    export_generated_headers: ["gpu_display_server_protocol_headers"],
144}
145