load("@rules_cc//cc:defs.bzl", "cc_library", "objc_library") load("//:build_variables.bzl", "GFXSTREAM_HOST_COPTS", "GFXSTREAM_HOST_DEFINES") package( default_applicable_licenses = ["//:gfxstream_license"], default_visibility = ["//:gfxstream"], ) cc_library( name = "gles1_dec", srcs = [ "gles1_dec/GLESv1Decoder.cpp", "gles1_dec/gles1_dec.cpp", "gles1_dec/gles1_server_context.cpp", ], hdrs = glob(["gles1_dec/*.h"]), copts = GFXSTREAM_HOST_COPTS, defines = GFXSTREAM_HOST_DEFINES, deps = [ ":gfxstream_glsnapshot", "//common/base:gfxstream_common_base", "//common/logging:gfxstream_common_logging", "//host/decoder_common:gfxstream_host_decoder_common", "//host/gl/OpenGLESDispatch:gfxstream_host_openglesdispatch_headers", "//host/iostream:gfxstream_host_iostream", "//host/library:gfxstream_host_library", "//third_party/opengl:gfxstream_egl_headers", "//third_party/opengl:gfxstream_gles_headers", "//third_party/opengl:gfxstream_opengl_headers", ], ) cc_library( name = "gl_common_headers", hdrs = glob(["glestranslator/GLcommon/include/**/*.h"]), copts = GFXSTREAM_HOST_COPTS, defines = GFXSTREAM_HOST_DEFINES, includes = ["glestranslator/GLcommon/include"], deps = [ "//common/base:gfxstream_common_base", "//common/etc:gfxstream_etc", "//common/logging:gfxstream_common_logging", "//host:gfxstream_backend_headers", "//host/decoder_common:gfxstream_host_decoder_common", "//host/gl/OpenGLESDispatch:gfxstream_host_openglesdispatch_headers", "//host/snapshot:gfxstream_host_snapshot", "//third_party/opengl:gfxstream_egl_headers", "//third_party/opengl:gfxstream_gles2_headers", "//third_party/opengl:gfxstream_gles3_headers", "//third_party/opengl:gfxstream_gles_headers", "//third_party/opengl:gfxstream_opengl_headers", ], ) objc_library( name = "egl_translator-darwin", srcs = [ "glestranslator/EGL/MacNative.m", "glestranslator/EGL/MacPixelFormatsAttribs.m", ] + glob(["glestranslator/EGL/*.h"]), copts = GFXSTREAM_HOST_COPTS + [ "-Wno-deprecated-declarations", ], defines = GFXSTREAM_HOST_DEFINES, sdk_frameworks = [ "IOSurface", "AppKit", "CoreGraphics", "OpenGL", ], target_compatible_with = [ "@platforms//os:macos", ], alwayslink = True, ) cc_library( name = "EGL_translator_static", srcs = [ "glestranslator/EGL/ClientAPIExts.cpp", "glestranslator/EGL/EglConfig.cpp", "glestranslator/EGL/EglContext.cpp", "glestranslator/EGL/EglDisplay.cpp", "glestranslator/EGL/EglGlobalInfo.cpp", "glestranslator/EGL/EglImp.cpp", "glestranslator/EGL/EglOsApi_egl.cpp", "glestranslator/EGL/EglPbufferSurface.cpp", "glestranslator/EGL/EglSurface.cpp", "glestranslator/EGL/EglThreadInfo.cpp", "glestranslator/EGL/EglValidate.cpp", "glestranslator/EGL/EglWindowSurface.cpp", "glestranslator/EGL/ShaderCache.cpp", "glestranslator/EGL/ThreadInfo.cpp", ] + select({ "@platforms//os:macos": [ "glestranslator/EGL/EglOsApi_darwin.cpp", ], "@platforms//os:windows": [ "glestranslator/EGL/CoreProfileConfigs_windows.cpp", "glestranslator/EGL/EglOsApi_wgl.cpp", ], "@platforms//os:linux": [ "glestranslator/EGL/CoreProfileConfigs_linux.cpp", "glestranslator/EGL/EglOsApi_glx.cpp", "glestranslator/EGL/X11ErrorHandler.cpp", ], "//conditions:default": [], }), hdrs = [ "glestranslator/EGL/ClientAPIExts.h", "glestranslator/EGL/CoreProfileConfigs.h", "glestranslator/EGL/EglConfig.h", "glestranslator/EGL/EglContext.h", "glestranslator/EGL/EglDisplay.h", "glestranslator/EGL/EglGlobalInfo.h", "glestranslator/EGL/EglOsApi.h", "glestranslator/EGL/EglPbufferSurface.h", "glestranslator/EGL/EglSurface.h", "glestranslator/EGL/EglThreadInfo.h", "glestranslator/EGL/EglValidate.h", "glestranslator/EGL/EglWindowSurface.h", "glestranslator/EGL/ShaderCache.h", "glestranslator/EGL/ThreadInfo.h", ] + select({ "@platforms//os:macos": [ "glestranslator/EGL/MacNative.h", "glestranslator/EGL/MacPixelFormatsAttribs.h", ], "@platforms//os:windows": [ ], "@platforms//os:linux": [ "glestranslator/EGL/X11ErrorHandler.h", ], "//conditions:default": [], }), copts = GFXSTREAM_HOST_COPTS + [ "-Wno-extern-c-compat", "-Wno-inconsistent-missing-override", "-Wno-return-type-c-linkage", ], defines = GFXSTREAM_HOST_DEFINES, textual_hdrs = [ "glestranslator/EGL/ClientAPIExts.in", ], deps = [ ":gl_common_headers", "//common/base:gfxstream_common_base", "//common/etc:gfxstream_etc", "//common/logging:gfxstream_common_logging", "//common/utils:gfxstream_common_utils", "//host:gfxstream_backend_headers", "//host:gfxstream_host_headers", "//host/backend:gfxstream_host_backend", "//host/decoder_common:gfxstream_host_decoder_common", "//host/gl/glestranslator/GLES_CM:GLES_CM_translator_static", "//host/gl/glestranslator/GLES_V2:GLES_V2_translator_static", "//host/library:gfxstream_host_library", "//third_party/opengl:gfxstream_egl_headers", "//third_party/opengl:gfxstream_gles2_headers", "//third_party/opengl:gfxstream_gles_headers", "//third_party/opengl:gfxstream_glx_headers", "//third_party/opengl:gfxstream_opengl_headers", "//third_party/x11:gfxstream_x11_headers", ] + select({ "@platforms//os:macos": [":egl_translator-darwin"], "//conditions:default": [], }), alwayslink = True, ) cc_library( name = "gl_common", srcs = [ "glestranslator/GLcommon/FramebufferData.cpp", "glestranslator/GLcommon/GLBackgroundLoader.cpp", "glestranslator/GLcommon/GLDispatch.cpp", "glestranslator/GLcommon/GLESbuffer.cpp", "glestranslator/GLcommon/GLEScontext.cpp", "glestranslator/GLcommon/GLESpointer.cpp", "glestranslator/GLcommon/GLESvalidate.cpp", "glestranslator/GLcommon/GLutils.cpp", "glestranslator/GLcommon/NamedObject.cpp", "glestranslator/GLcommon/ObjectData.cpp", "glestranslator/GLcommon/ObjectNameSpace.cpp", "glestranslator/GLcommon/PaletteTexture.cpp", "glestranslator/GLcommon/RangeManip.cpp", "glestranslator/GLcommon/SaveableTexture.cpp", "glestranslator/GLcommon/ScopedGLState.cpp", "glestranslator/GLcommon/ShareGroup.cpp", "glestranslator/GLcommon/TextureData.cpp", "glestranslator/GLcommon/TextureUtils.cpp", "glestranslator/GLcommon/rgtc.cpp", ], copts = GFXSTREAM_HOST_COPTS + [ "-Wno-extern-c-compat", ], defines = GFXSTREAM_HOST_DEFINES, deps = [ ":gl_common_headers", "//common/base:gfxstream_common_base", "//common/etc:gfxstream_etc", "//common/logging:gfxstream_common_logging", "//host:gfxstream_backend_headers", "//host/backend:gfxstream_host_backend", "//host/compressed_textures:gfxstream_host_compressed_textures", "//host/library:gfxstream_host_library", "//third_party/opengl:gfxstream_egl_headers", "//third_party/opengl:gfxstream_gles2_headers", "//third_party/opengl:gfxstream_gles3_headers", "//third_party/opengl:gfxstream_gles_headers", "//third_party/opengl:gfxstream_glx_headers", "//third_party/opengl:gfxstream_opengl_headers", ], ) cc_library( name = "gles2_dec", srcs = [ "gles2_dec/GLESv2Decoder.cpp", "gles2_dec/gles2_dec.cpp", "gles2_dec/gles2_server_context.cpp", ], hdrs = glob(["gles2_dec/*.h"]), copts = GFXSTREAM_HOST_COPTS, defines = GFXSTREAM_HOST_DEFINES, deps = [ ":gfxstream_glsnapshot", "//common/base:gfxstream_common_base", "//common/logging:gfxstream_common_logging", "//host/backend:gfxstream_host_backend", "//host/decoder_common:gfxstream_host_decoder_common", "//host/gl/OpenGLESDispatch:gfxstream_host_openglesdispatch_headers", "//host/iostream:gfxstream_host_iostream", "//host/library:gfxstream_host_library", "//third_party/opengl:gfxstream_egl_headers", "//third_party/opengl:gfxstream_gles2_headers", "//third_party/opengl:gfxstream_gles3_headers", ], ) cc_library( name = "gfxstream_glsnapshot", srcs = ["glsnapshot/GLSnapshot.cpp"], hdrs = ["glsnapshot/GLSnapshot.h"], copts = GFXSTREAM_HOST_COPTS + [ "-Wno-extern-c-compat", ], defines = GFXSTREAM_HOST_DEFINES, includes = ["glsnapshot"], deps = [ "//host/decoder_common:gfxstream_host_decoder_common", "//host/gl/OpenGLESDispatch:gfxstream_host_openglesdispatch", "//host/gl/OpenGLESDispatch:gfxstream_host_openglesdispatch_headers", "//third_party/opengl:gfxstream_gles2_headers", "//third_party/opengl:gfxstream_gles3_headers", ], ) cc_library( name = "gfxstream_opengl_server_headers", hdrs = [ "BorrowedImageGl.h", "BufferGl.h", "ColorBufferGl.h", "CompositorGl.h", "ContextHelper.h", "DebugGl.h", "DisplayGl.h", "DisplaySurfaceGl.h", "EmulatedEglConfig.h", "EmulatedEglContext.h", "EmulatedEglFenceSync.h", "EmulatedEglImage.h", "EmulatedEglWindowSurface.h", "EmulationGl.h", "GLESVersionDetector.h", "PixelReadFormats.h", "ReadbackWorkerGl.h", "RenderThreadInfoGl.h", "TextureDraw.h", "TextureResize.h", "YUVConverter.h", ], copts = GFXSTREAM_HOST_COPTS, defines = GFXSTREAM_HOST_DEFINES, includes = ["."], deps = [ ":gfxstream_glsnapshot", ":gl_common_headers", ":gles1_dec", ":gles2_dec", "//common/base:gfxstream_common_base", "//common/logging:gfxstream_common_logging", "//common/utils:gfxstream_common_utils", "//host:gfxstream_backend_headers", "//host:gfxstream_host_headers", "//host/backend:gfxstream_host_backend", "//host/decoder_common:gfxstream_host_decoder_common", "//host/features:gfxstream_host_features", "//host/gl/OpenGLESDispatch:gfxstream_host_openglesdispatch", "//host/gl/OpenGLESDispatch:gfxstream_host_openglesdispatch_headers", "//third_party/opengl:gfxstream_egl_headers", "//third_party/opengl:gfxstream_gles2_headers", "//third_party/opengl:gfxstream_gles3_headers", "//third_party/opengl:gfxstream_gles_headers", "//third_party/opengl:gfxstream_opengl_headers", ], ) cc_library( name = "gfxstream_opengl_server", srcs = [ "BufferGl.cpp", "ColorBufferGl.cpp", "CompositorGl.cpp", "DebugGl.cpp", "DisplayGl.cpp", "DisplaySurfaceGl.cpp", "EmulatedEglConfig.cpp", "EmulatedEglContext.cpp", "EmulatedEglFenceSync.cpp", "EmulatedEglImage.cpp", "EmulatedEglWindowSurface.cpp", "EmulationGl.cpp", "GLESVersionDetector.cpp", "PixelReadFormats.cpp", "ReadbackWorkerGl.cpp", "RenderThreadInfoGl.cpp", "TextureDraw.cpp", "TextureResize.cpp", "YUVConverter.cpp", ], hdrs = [ "BorrowedImageGl.h", "BufferGl.h", "ColorBufferGl.h", "CompositorGl.h", "ContextHelper.h", "DebugGl.h", "DisplayGl.h", "DisplaySurfaceGl.h", "EmulatedEglConfig.h", "EmulatedEglContext.h", "EmulatedEglFenceSync.h", "EmulatedEglImage.h", "EmulatedEglWindowSurface.h", "EmulationGl.h", "GLESVersionDetector.h", "PixelReadFormats.h", "ReadbackWorkerGl.h", "RenderThreadInfoGl.h", "TextureDraw.h", "TextureResize.h", "YUVConverter.h", ], copts = GFXSTREAM_HOST_COPTS + [ "-Wno-extern-c-compat", ], defines = GFXSTREAM_HOST_DEFINES, includes = [ ".", ], deps = [ ":gfxstream_glsnapshot", ":gl_common_headers", ":gles1_dec", ":gles2_dec", "//common/base:gfxstream_common_base", "//common/logging:gfxstream_common_logging", "//common/utils:gfxstream_common_utils", "//host:gfxstream_backend_headers", "//host:gfxstream_host_headers", "//host/backend:gfxstream_host_backend", "//host/decoder_common:gfxstream_host_decoder_common", "//host/features:gfxstream_host_features", "//host/gl/OpenGLESDispatch:gfxstream_host_openglesdispatch", "//host/gl/OpenGLESDispatch:gfxstream_host_openglesdispatch_headers", "//third_party/opengl:gfxstream_egl_headers", "//third_party/opengl:gfxstream_gles2_headers", "//third_party/opengl:gfxstream_gles3_headers", "//third_party/opengl:gfxstream_gles_headers", "//third_party/opengl:gfxstream_opengl_headers", ], )