load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "objc_library") cc_library( name = "gfxstream_backend_headers", hdrs = glob(["include/**/*.h"]), copts = ["-fno-exceptions"], includes = ["include"], visibility = ["//visibility:public"], ) cc_library( name = "gfxstream_host_headers", hdrs = [ "compressedTextureFormats/AstcCpuDecompressor.h", ] + glob([ "*.h", ]), copts = ["-fno-exceptions"], includes = ["."], visibility = [":__subpackages__"], ) cc_library( name = "gfxstream-compressedTextures", srcs = ["compressedTextureFormats/AstcCpuDecompressorNoOp.cpp"] + glob(["compressedTextureFormats/*.h"]), hdrs = [ "compressedTextureFormats/AstcCpuDecompressor.h", ], copts = ["-fno-exceptions"], includes = ["."], visibility = ["//visibility:public"], deps = [ "//common/etc:gfxstream_etc", ], ) cc_test( name = "gfxstream-compressedTextures_unittests", srcs = ["compressedTextureFormats/AstcCpuDecompressor_unittest.cpp"], copts = ["-fno-exceptions"], deps = [ ":gfxstream-compressedTextures", "@aemu//base:aemu-base", "@aemu//host-common:logging", "@com_google_googletest//:gtest_main", ], ) objc_library( name = "gfxstream_backend_static-darwin", srcs = [ "GlesCompat.h", "NativeSubWindow.h", "NativeSubWindow_cocoa.mm", ], copts = [ "-fno-exceptions", "-Wno-deprecated-declarations", ], defines = [ "EMUGL_BUILD", "GFXSTREAM_ENABLE_HOST_GLES=1", ], sdk_frameworks = [ "AppKit", "QuartzCore", "IOSurface", ], target_compatible_with = [ "@platforms//os:macos", ], deps = [ ":gfxstream_backend_headers", "//:gfxstream-gl-host-common-headers", "//common/opengl:gfxstream_opengl_headers", ], ) cc_library( name = "gfxstream_backend_static", srcs = [ "Buffer.cpp", "ChannelStream.cpp", "ColorBuffer.cpp", "DisplaySurface.cpp", "DisplaySurfaceUser.cpp", "ExternalObjectManager.cpp", "FrameBuffer.cpp", "GfxStreamAgents.cpp", "GraphicsDriverLock.cpp", "Hwc2.cpp", "PostWorker.cpp", "PostWorkerGl.cpp", "ReadBuffer.cpp", "RenderChannelImpl.cpp", "RenderControl.cpp", "RenderLibImpl.cpp", "RenderThread.cpp", "RenderThreadInfo.cpp", "RenderThreadInfoGl.cpp", "RenderThreadInfoMagma.cpp", "RenderWindow.cpp", "RendererImpl.cpp", "RingStream.cpp", "SyncThread.cpp", "VirtioGpuContext.cpp", "VirtioGpuFrontend.cpp", "VirtioGpuResource.cpp", "VirtioGpuRingBlob.cpp", "VirtioGpuTimelines.cpp", "VsyncThread.cpp", ] + select({ "@platforms//os:macos": [], "@platforms//os:windows": ["NativeSubWindow_win32.cpp"], "@platforms//os:linux": ["NativeSubWindow_x11.cpp"], "//conditions:default": [], }) + glob([ "*.h", ]), copts = [ "-Wno-return-type-c-linkage", "-Wno-extern-c-compat", "-fno-exceptions", ], defines = [ "QEMU_NEXT", "EMUGL_BUILD", "GFXSTREAM_ENABLE_HOST_GLES=1", ] + select({ "@platforms//os:windows": [ "WIN32_LEAN_AND_MEAN", ], "//conditions:default": [], }), includes = [ ".", "gl", ], linkstatic = True, visibility = ["//visibility:public"], deps = [ ":gfxstream_backend_headers", "//:gfxstream-gl-host-common-headers", "//host/apigen-codec-common", "//host/backend:gfxstream_backend", "//host/features:gfxstream_features", "//host/gl:EGL_translator_static", "//host/gl:OpenGLESDispatch", "//host/gl:gfxstream-gl-host-common", "//host/gl:gfxstream-gl-server", "//host/gl:gl-common-headers", "//host/gl:gl_headers", "//host/gl:gles1_dec", "//host/gl:gles2_dec", "//host/gl/glestranslator/GLES_CM:GLES_CM_translator_static", "//host/magma:gfxstream-magma-server", "//host/magma:magma-headers", "//host/renderControl_dec", "//host/tracing:gfxstream_host_tracing", "//host/vulkan:gfxstream-vulkan-server", "@aemu//base:aemu-base", "@aemu//base:aemu-base-metrics", "@aemu//host-common:aemu-host-common", "@aemu//host-common:logging", "@aemu//snapshot:aemu-snapshot", ] + select({ "@platforms//os:macos": [ ":gfxstream_backend_static-darwin", ], "//conditions:default": [], }), ) cc_library( name = "gfxstream_backend_shared", srcs = [ "render_api.cpp", "virtio-gpu-gfxstream-renderer.cpp", ], copts = [ "-fno-exceptions", "-Wno-extern-c-compat", "-Wno-return-type-c-linkage", ], defines = [ "EMUGL_BUILD", "BUILDING_EMUGL_COMMON_SHARED", "WIN32_LEAN_AND_MEAN", ], linkstatic = True, visibility = ["//visibility:public"], deps = [ ":gfxstream_backend_static", "//:gfxstream-gl-host-common-headers", "//common/utils:gfxstream_common_utils", "//host/gl:gfxstream-gl-host-common", "@aemu//base:aemu-base", "@aemu//base:aemu-base-metrics", "@aemu//host-common:aemu-host-common-product-feature-override", ], ) cc_binary( name = "gfxstream_backend", srcs = [ "render_api.cpp", "virtio-gpu-gfxstream-renderer.cpp", ], copts = ["-fno-exceptions"], linkshared = True, visibility = ["//visibility:public"], deps = [ ":gfxstream_backend_static", "//:gfxstream-gl-host-common-headers", "//common/utils:gfxstream_common_utils", "//host/gl:gfxstream-gl-host-common", "@aemu//base:aemu-base", "@aemu//base:aemu-base-metrics", "@aemu//host-common:aemu-host-common-product-feature-override", ], ) # Note: It looks like cc_shared_library refuses to include objc_library # b/331235218 # cc_shared_library( # name = "gfxstream_backend", # visibility = ["//visibility:public"], # deps = [":gfxstream_backend_shared"], # )