Erwin Jansen | b45c014 | 2024-03-15 14:36:45 -0700 | [diff] [blame] | 1 | cc_library( |
| 2 | name = "gfxstream_backend_headers", |
| 3 | hdrs = glob(["include/**/*.h"]), |
| 4 | includes = ["include"], |
| 5 | visibility = ["//visibility:public"], |
| 6 | ) |
| 7 | |
| 8 | cc_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 | |
| 20 | cc_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 | |
| 33 | cc_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 | |
| 44 | objc_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 Jansen | 45e3604 | 2024-03-25 11:43:25 -0700 | [diff] [blame] | 55 | sdk_frameworks = [ |
| 56 | "AppKit", |
| 57 | "QuartzCore", |
| 58 | "IOSurface", |
| 59 | ], |
Erwin Jansen | b45c014 | 2024-03-15 14:36:45 -0700 | [diff] [blame] | 60 | deps = [ |
| 61 | ":gfxstream_backend_headers", |
| 62 | "//external/angle:angle-headers", |
| 63 | "//hardware/google/gfxstream:gfxstream-gl-host-common-headers", |
| 64 | ], |
| 65 | ) |
| 66 | |
| 67 | cc_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 Jansen | 45e3604 | 2024-03-25 11:43:25 -0700 | [diff] [blame] | 120 | linkstatic = True, |
Erwin Jansen | b45c014 | 2024-03-15 14:36:45 -0700 | [diff] [blame] | 121 | 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 Jansen | 45e3604 | 2024-03-25 11:43:25 -0700 | [diff] [blame] | 127 | "//hardware/google/aemu/host-common:logging", |
Erwin Jansen | b45c014 | 2024-03-15 14:36:45 -0700 | [diff] [blame] | 128 | "//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 Jansen | 45e3604 | 2024-03-25 11:43:25 -0700 | [diff] [blame] | 145 | ] + select({ |
| 146 | "@platforms//os:macos": [ |
| 147 | ":gfxstream_backend_static-darwin", |
| 148 | ], |
| 149 | "//conditions:default": [], |
| 150 | }), |
Erwin Jansen | b45c014 | 2024-03-15 14:36:45 -0700 | [diff] [blame] | 151 | ) |
| 152 | |
| 153 | cc_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 Jansen | 45e3604 | 2024-03-25 11:43:25 -0700 | [diff] [blame] | 168 | linkstatic = True, |
Erwin Jansen | 90819b8 | 2024-05-06 12:41:20 -0700 | [diff] [blame] | 169 | visibility = ["//visibility:public"], |
Erwin Jansen | b45c014 | 2024-03-15 14:36:45 -0700 | [diff] [blame] | 170 | deps = [ |
| 171 | ":gfxstream_backend_static", |
Erwin Jansen | 45e3604 | 2024-03-25 11:43:25 -0700 | [diff] [blame] | 172 | "//hardware/google/aemu/base:aemu-base", |
| 173 | "//hardware/google/aemu/base:aemu-base-metrics", |
Erwin Jansen | b45c014 | 2024-03-15 14:36:45 -0700 | [diff] [blame] | 174 | "//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 Jansen | 45e3604 | 2024-03-25 11:43:25 -0700 | [diff] [blame] | 177 | "//hardware/google/gfxstream/host/gl:gfxstream-gl-host-common", |
Erwin Jansen | b45c014 | 2024-03-15 14:36:45 -0700 | [diff] [blame] | 178 | ], |
| 179 | ) |
| 180 | |
Erwin Jansen | 45e3604 | 2024-03-25 11:43:25 -0700 | [diff] [blame] | 181 | cc_binary( |
Erwin Jansen | b45c014 | 2024-03-15 14:36:45 -0700 | [diff] [blame] | 182 | name = "gfxstream_backend", |
Erwin Jansen | 45e3604 | 2024-03-25 11:43:25 -0700 | [diff] [blame] | 183 | srcs = [ |
| 184 | "render_api.cpp", |
| 185 | "virtio-gpu-gfxstream-renderer.cpp", |
| 186 | ], |
| 187 | linkshared = True, |
Erwin Jansen | 876ff21 | 2024-05-07 15:58:50 -0700 | [diff] [blame] | 188 | visibility = ["//visibility:public"], |
Erwin Jansen | 45e3604 | 2024-03-25 11:43:25 -0700 | [diff] [blame] | 189 | 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 Jansen | b45c014 | 2024-03-15 14:36:45 -0700 | [diff] [blame] | 198 | ) |
Erwin Jansen | 45e3604 | 2024-03-25 11:43:25 -0700 | [diff] [blame] | 199 | |
| 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 | # ) |