blob: 242b3e46bb13689e92672a475f4a5bd045f38cd5 [file] [log] [blame]
Erwin Jansenb45c0142024-03-15 14:36:45 -07001cc_library(
2 name = "gfxstream_backend_headers",
3 hdrs = glob(["include/**/*.h"]),
4 includes = ["include"],
5 visibility = ["//visibility:public"],
6)
7
8cc_library(
9 name = "gfxstream_host_headers",
10 hdrs = [
11 "compressedTextureFormats/AstcCpuDecompressor.h",
12 ] + glob([
13 "*.h",
14 "gl/*.h",
15 ]),
16 includes = ["."],
17 visibility = [":__subpackages__"],
18)
19
20cc_library(
21 name = "gfxstream-compressedTextures",
22 srcs = ["compressedTextureFormats/AstcCpuDecompressorNoOp.cpp"] + glob(["compressedTextureFormats/*.h"]),
23 hdrs = [
24 "compressedTextureFormats/AstcCpuDecompressor.h",
25 ],
26 includes = ["."],
27 visibility = ["//visibility:public"],
28 deps = [
29 "//hardware/google/gfxstream/common/etc:gfxstream_etc",
30 ],
31)
32
33cc_test(
34 name = "gfxstream-compressedTextures_unittests",
35 srcs = ["compressedTextureFormats/AstcCpuDecompressor_unittest.cpp"],
36 deps = [
37 ":gfxstream-compressedTextures",
38 "//hardware/google/aemu/base:aemu-base",
39 "//hardware/google/aemu/host-common:logging",
40 "@com_google_googletest//:gtest_main",
41 ],
42)
43
44objc_library(
45 name = "gfxstream_backend_static-darwin",
46 srcs = [
47 "GlesCompat.h",
48 "NativeSubWindow.h",
49 "NativeSubWindow_cocoa.mm",
50 ],
51 defines = [
52 "EMUGL_BUILD",
53 "GFXSTREAM_ENABLE_HOST_GLES=1",
54 ],
Erwin Jansen45e36042024-03-25 11:43:25 -070055 sdk_frameworks = [
56 "AppKit",
57 "QuartzCore",
58 "IOSurface",
59 ],
Erwin Jansenb45c0142024-03-15 14:36:45 -070060 deps = [
61 ":gfxstream_backend_headers",
62 "//external/angle:angle-headers",
63 "//hardware/google/gfxstream:gfxstream-gl-host-common-headers",
64 ],
65)
66
67cc_library(
68 name = "gfxstream_backend_static",
69 srcs = [
70 "BlobManager.cpp",
71 "Buffer.cpp",
72 "ChannelStream.cpp",
73 "ColorBuffer.cpp",
74 "DisplaySurface.cpp",
75 "DisplaySurfaceUser.cpp",
76 "FrameBuffer.cpp",
77 "GfxStreamAgents.cpp",
78 "Hwc2.cpp",
79 "PostWorker.cpp",
80 "PostWorkerGl.cpp",
81 "ReadBuffer.cpp",
82 "RenderChannelImpl.cpp",
83 "RenderControl.cpp",
84 "RenderLibImpl.cpp",
85 "RenderThread.cpp",
86 "RenderThreadInfo.cpp",
87 "RenderThreadInfoGl.cpp",
88 "RenderThreadInfoMagma.cpp",
89 "RenderWindow.cpp",
90 "RendererImpl.cpp",
91 "RingStream.cpp",
92 "SyncThread.cpp",
93 "VirtioGpuTimelines.cpp",
94 "VsyncThread.cpp",
95 ] + select({
96 "@platforms//os:macos": [],
97 "@platforms//os:windows": ["NativeSubWindow_win32.cpp"],
98 "@platforms//os:linux": ["NativeSubWindow_x11.cpp"],
99 "//conditions:default": [],
100 }) + glob([
101 "*.h",
102 ]),
103 copts = [
104 "-Wno-return-type-c-linkage",
105 "-Wno-extern-c-compat",
106 ],
107 defines = [
108 "EMUGL_BUILD",
109 "GFXSTREAM_ENABLE_HOST_GLES=1",
110 ] + select({
111 "@platforms//os:windows": [
112 "WIN32_LEAN_AND_MEAN",
113 ],
114 "//conditions:default": [],
115 }),
116 includes = [
117 ".",
118 "gl",
119 ],
Erwin Jansen45e36042024-03-25 11:43:25 -0700120 linkstatic = True,
Erwin Jansenb45c0142024-03-15 14:36:45 -0700121 visibility = ["//visibility:public"],
122 deps = [
123 ":gfxstream_backend_headers",
124 "//hardware/google/aemu/base:aemu-base",
125 "//hardware/google/aemu/base:aemu-base-metrics",
126 "//hardware/google/aemu/host-common:aemu-host-common",
Erwin Jansen45e36042024-03-25 11:43:25 -0700127 "//hardware/google/aemu/host-common:logging",
Erwin Jansenb45c0142024-03-15 14:36:45 -0700128 "//hardware/google/aemu/snapshot:aemu-snapshot",
129 "//hardware/google/gfxstream:gfxstream-gl-host-common-headers",
130 "//hardware/google/gfxstream/host/apigen-codec-common",
131 "//hardware/google/gfxstream/host/features:gfxstream_features",
132 "//hardware/google/gfxstream/host/gl:EGL_translator_static",
133 "//hardware/google/gfxstream/host/gl:OpenGLESDispatch",
134 "//hardware/google/gfxstream/host/gl:gfxstream-gl-host-common",
135 "//hardware/google/gfxstream/host/gl:gfxstream-gl-server",
136 "//hardware/google/gfxstream/host/gl:gl-common-headers",
137 "//hardware/google/gfxstream/host/gl:gl_headers",
138 "//hardware/google/gfxstream/host/gl:gles1_dec",
139 "//hardware/google/gfxstream/host/gl:gles2_dec",
140 "//hardware/google/gfxstream/host/gl/glestranslator/GLES_CM:GLES_CM_translator_static",
141 "//hardware/google/gfxstream/host/magma:gfxstream-magma-server",
142 "//hardware/google/gfxstream/host/magma:magma-headers",
143 "//hardware/google/gfxstream/host/renderControl_dec",
144 "//hardware/google/gfxstream/host/vulkan:gfxstream-vulkan-server",
Erwin Jansen45e36042024-03-25 11:43:25 -0700145 ] + select({
146 "@platforms//os:macos": [
147 ":gfxstream_backend_static-darwin",
148 ],
149 "//conditions:default": [],
150 }),
Erwin Jansenb45c0142024-03-15 14:36:45 -0700151)
152
153cc_library(
154 name = "gfxstream_backend_shared",
155 srcs = [
156 "render_api.cpp",
157 "virtio-gpu-gfxstream-renderer.cpp",
158 ],
159 copts = [
160 "-Wno-extern-c-compat",
161 "-Wno-return-type-c-linkage",
162 ],
163 defines = [
164 "EMUGL_BUILD",
165 "BUILDING_EMUGL_COMMON_SHARED",
166 "WIN32_LEAN_AND_MEAN",
167 ],
Erwin Jansen45e36042024-03-25 11:43:25 -0700168 linkstatic = True,
Erwin Jansen90819b82024-05-06 12:41:20 -0700169 visibility = ["//visibility:public"],
Erwin Jansenb45c0142024-03-15 14:36:45 -0700170 deps = [
171 ":gfxstream_backend_static",
Erwin Jansen45e36042024-03-25 11:43:25 -0700172 "//hardware/google/aemu/base:aemu-base",
173 "//hardware/google/aemu/base:aemu-base-metrics",
Erwin Jansenb45c0142024-03-15 14:36:45 -0700174 "//hardware/google/aemu/host-common:aemu-host-common-product-feature-override",
175 "//hardware/google/gfxstream:gfxstream-gl-host-common-headers",
176 "//hardware/google/gfxstream/common/utils:gfxstream_common_utils",
Erwin Jansen45e36042024-03-25 11:43:25 -0700177 "//hardware/google/gfxstream/host/gl:gfxstream-gl-host-common",
Erwin Jansenb45c0142024-03-15 14:36:45 -0700178 ],
179)
180
Erwin Jansen45e36042024-03-25 11:43:25 -0700181cc_binary(
Erwin Jansenb45c0142024-03-15 14:36:45 -0700182 name = "gfxstream_backend",
Erwin Jansen45e36042024-03-25 11:43:25 -0700183 srcs = [
184 "render_api.cpp",
185 "virtio-gpu-gfxstream-renderer.cpp",
186 ],
187 linkshared = True,
Erwin Jansen876ff212024-05-07 15:58:50 -0700188 visibility = ["//visibility:public"],
Erwin Jansen45e36042024-03-25 11:43:25 -0700189 deps = [
190 ":gfxstream_backend_static",
191 "//hardware/google/aemu/base:aemu-base",
192 "//hardware/google/aemu/base:aemu-base-metrics",
193 "//hardware/google/aemu/host-common:aemu-host-common-product-feature-override",
194 "//hardware/google/gfxstream:gfxstream-gl-host-common-headers",
195 "//hardware/google/gfxstream/common/utils:gfxstream_common_utils",
196 "//hardware/google/gfxstream/host/gl:gfxstream-gl-host-common",
197 ],
Erwin Jansenb45c0142024-03-15 14:36:45 -0700198)
Erwin Jansen45e36042024-03-25 11:43:25 -0700199
200# Note: It looks like cc_shared_library refuses to include objc_library
201# b/331235218
202# cc_shared_library(
203# name = "gfxstream_backend",
204# visibility = ["//visibility:public"],
205# deps = [":gfxstream_backend_shared"],
206# )