xref: /aosp_15_r20/external/crosvm/rutabaga_gfx/patches/Android.bp.patch (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1diff --git a/rutabaga_gfx/Android.bp b/rutabaga_gfx/Android.bp
2index ab64209dd..1795150d6 100644
3--- a/rutabaga_gfx/Android.bp
4+++ b/rutabaga_gfx/Android.bp
5@@ -23,7 +23,6 @@ rust_library {
6     edition: "2021",
7     features: [
8         "gfxstream",
9-        "gfxstream_stub",
10         "virgl_renderer",
11     ],
12     rustlibs: [
13@@ -37,16 +36,82 @@ rust_library {
14         "libzerocopy",
15     ],
16     proc_macros: ["libremain"],
17-    static_libs: [
18-        "libgbm",
19-        "libvirglrenderer",
20+    cfgs: [
21+        "gfxstream_unstable",
22     ],
23     shared_libs: [
24-        "libdrm",
25+        "libc++",
26+        "libbase",
27+    ],
28+    target: {
29+        android: {
30+            shared_libs: [
31+                "libnativewindow",
32+                "libcutils",
33+                "liblog",
34+            ],
35+        },
36+        host: {
37+            features: ["vulkano"],
38+            rustlibs: [
39+                "libvulkano",
40+            ],
41+        },
42+    },
43+    static_libs: [
44         "libepoxy",
45+        "libgfxstream_backend",
46+        "libvirglrenderer",
47     ],
48 }
49
50+rust_library {
51+    name: "librutabaga_gfx_gfxstream",
52+    host_supported: true,
53+    vendor_available: true,
54+    crate_name: "rutabaga_gfx",
55+    cargo_env_compat: true,
56+    cargo_pkg_version: "0.1.2",
57+    srcs: ["src/lib.rs"],
58+    edition: "2021",
59+    rustlibs: [
60+        "libcfg_if",
61+        "liblibc",
62+        "liblog_rust",
63+        "libnix",
64+        "libserde",
65+        "libserde_json",
66+        "libthiserror",
67+        "libzerocopy",
68+    ],
69+    proc_macros: ["libremain"],
70+    target: {
71+        host: {
72+            cfgs: [
73+                "fence_passing_option1",
74+                "gfxstream_unstable",
75+            ],
76+            features: [
77+                "gfxstream",
78+                "vulkano",
79+            ],
80+            shared_libs: [
81+                "libgfxstream_backend",
82+            ],
83+            compile_multilib: "64",
84+            rustlibs: [
85+                "libvulkano",
86+            ],
87+        },
88+        android: {
89+            cfgs: [
90+                "fence_passing_option1",
91+                "gfxstream_unstable",
92+            ],
93+        },
94+    },
95+}
96+
97 rust_test {
98     name: "rutabaga_gfx_test_src_lib",
99     defaults: ["crosvm_inner_defaults"],
100@@ -63,7 +126,6 @@ rust_test {
101     edition: "2021",
102     features: [
103         "gfxstream",
104-        "gfxstream_stub",
105         "virgl_renderer",
106     ],
107     rustlibs: [
108@@ -77,12 +139,9 @@ rust_test {
109         "libzerocopy",
110     ],
111     proc_macros: ["libremain"],
112-    static_libs: [
113-        "libgbm",
114-        "libvirglrenderer",
115-    ],
116     shared_libs: [
117-        "libdrm",
118         "libepoxy",
119+        "libgfxstream_backend",
120+        "libvirglrenderer",
121     ],
122 }
123