load("@rules_cc//cc:defs.bzl", "cc_library", "cc_test") # Logging library cc_library( name = "logging-qemu2", srcs = [ "GfxstreamFatalError.cpp", "logging.cpp", ], hdrs = ["include/host-common/logging.h"], defines = [ "BUILDING_EMUGL_COMMON_SHARED", ] + select({ "@platforms//os:windows": [ "WIN32_LEAN_AND_MEAN", ], "//conditions:default": [], }), includes = ["include/host-common"], visibility = ["//visibility:public"], deps = [ ":aemu-host-common-headers", "//base:aemu-base-headers", "//base:aemu-base-metrics", ], ) cc_library( name = "logging", srcs = [ "GfxstreamFatalErrorAbsl.cpp", "logging_absl.cpp", ], hdrs = ["include/host-common/logging.h"], defines = [ "BUILDING_EMUGL_COMMON_SHARED", ] + select({ "@platforms//os:windows": [ "WIN32_LEAN_AND_MEAN", ], "//conditions:default": [], }), includes = ["include/host-common"], visibility = ["//visibility:public"], deps = [ ":aemu-host-common-headers", "//base:aemu-base-headers", "//base:aemu-base-metrics", "@abseil-cpp//absl/log", "@abseil-cpp//absl/log:absl_log", ], ) cc_library( name = "aemu-host-common-headers", hdrs = [ "include/host-common/AddressSpaceService.h", "include/host-common/AndroidAsyncMessagePipe.h", "include/host-common/AndroidPipe.h", "include/host-common/DeviceContextRunner.h", "include/host-common/DmaMap.h", "include/host-common/FeatureControl.h", "include/host-common/FeatureControlDefGuest.h", "include/host-common/FeatureControlDefHost.h", "include/host-common/Features.h", "include/host-common/GfxstreamFatalError.h", "include/host-common/GoldfishDma.h", "include/host-common/GoldfishMediaDefs.h", "include/host-common/GraphicsAgentFactory.h", "include/host-common/H264NaluParser.h", "include/host-common/H264PingInfoParser.h", "include/host-common/HostGoldfishPipe.h", "include/host-common/HostmemIdMapping.h", "include/host-common/MediaCodec.h", "include/host-common/MediaCudaDriverHelper.h", "include/host-common/MediaCudaUtils.h", "include/host-common/MediaCudaVideoHelper.h", "include/host-common/MediaFfmpegVideoHelper.h", "include/host-common/MediaH264Decoder.h", "include/host-common/MediaH264DecoderDefault.h", "include/host-common/MediaH264DecoderGeneric.h", "include/host-common/MediaH264DecoderPlugin.h", "include/host-common/MediaH264DecoderVideoToolBox.h", "include/host-common/MediaHevcDecoder.h", "include/host-common/MediaHostRenderer.h", "include/host-common/MediaSnapshotHelper.h", "include/host-common/MediaSnapshotState.h", "include/host-common/MediaTexturePool.h", "include/host-common/MediaVideoHelper.h", "include/host-common/MediaVideoToolBoxUtils.h", "include/host-common/MediaVideoToolBoxVideoHelper.h", "include/host-common/MediaVpxDecoder.h", "include/host-common/MediaVpxDecoderGeneric.h", "include/host-common/MediaVpxDecoderPlugin.h", "include/host-common/MediaVpxVideoHelper.h", "include/host-common/MultiDisplay.h", "include/host-common/MultiDisplayPipe.h", "include/host-common/RefcountPipe.h", "include/host-common/VmLock.h", "include/host-common/VpxFrameParser.h", "include/host-common/VpxPingInfoParser.h", "include/host-common/YuvConverter.h", "include/host-common/address_space_device.h", "include/host-common/address_space_device.hpp", "include/host-common/address_space_device_control_ops.h", "include/host-common/address_space_graphics.h", "include/host-common/address_space_host_media.h", "include/host-common/address_space_host_memory_allocator.h", "include/host-common/address_space_shared_slots_host_memory_allocator.h", "include/host-common/android_pipe_base.h", "include/host-common/android_pipe_common.h", "include/host-common/android_pipe_device.h", "include/host-common/android_pipe_host.h", "include/host-common/constants.h", "include/host-common/crash-handler.h", "include/host-common/crash_reporter.h", "include/host-common/debug.h", "include/host-common/display_agent.h", "include/host-common/dynlink_cuda.h", "include/host-common/dynlink_cuda_cuda.h", "include/host-common/dynlink_cuviddec.h", "include/host-common/dynlink_nvcuvid.h", "include/host-common/emugl_vm_operations.h", "include/host-common/feature_control.h", "include/host-common/feature_control_base.h", "include/host-common/globals.h", "include/host-common/goldfish_pipe.h", "include/host-common/hw-config.h", "include/host-common/hw-config-defs.h", "include/host-common/hw-config-helper.h", "include/host-common/hw-lcd.h", "include/host-common/linux_types.h", "include/host-common/logging.h", "include/host-common/misc.h", "include/host-common/multi_display_agent.h", "include/host-common/opengles.h", "include/host-common/record_screen_agent.h", "include/host-common/refcount-pipe.h", "include/host-common/screen-recorder.h", "include/host-common/vm_operations.h", "include/host-common/window_agent.h", ], includes = ["include"], visibility = ["//visibility:public"], ) # Standalone Library (conditional) cc_library( name = "aemu-host-common", srcs = [ "AndroidPipe.cpp", "GraphicsAgentFactory.cpp", "HostmemIdMapping.cpp", "RefcountPipe.cpp", "crash_reporter.cpp", "empty-crash-handler.cpp", "feature_control.cpp", "hw-config.cpp", "window_operations.cpp", ], hdrs = [":aemu-host-common-headers"], copts = [ "-Wno-return-type-c-linkage", "-Wno-extern-c-compat", ], defines = [ "BUILDING_EMUGL_COMMON_SHARED", ] + select({ "@platforms//os:windows": [ "WIN32_LEAN_AND_MEAN", ], "//conditions:default": [], }), visibility = ["//visibility:public"], deps = [ ":aemu-host-common-headers", ":logging", "//base:aemu-base-allocator", "//base:aemu-base-headers", ], alwayslink = 1, ) # Override Library cc_library( name = "aemu-host-common-product-feature-override", srcs = ["FeatureControlOverride.cpp"], defines = [ "BUILDING_EMUGL_COMMON_SHARED", ] + select({ "@platforms//os:windows": [ "WIN32_LEAN_AND_MEAN", ], "//conditions:default": [], }), includes = ["include"], visibility = ["//visibility:public"], deps = [ ":aemu-host-common-headers", "//base:aemu-base-headers", ], ) cc_library( name = "aemu-host-common-testing-support", srcs = [ "testing/HostAddressSpace.cpp", "testing/MockAndroidEmulatorWindowAgent.cpp", "testing/MockAndroidMultiDisplayAgent.cpp", "testing/MockAndroidVmOperations.cpp", "testing/MockGraphicsAgentFactory.cpp", ], hdrs = [ "testing/HostAddressSpace.h", "testing/MockAndroidEmulatorWindowAgent.h", "testing/MockAndroidVmOperations.h", "testing/MockGraphicsAgentFactory.h", ], includes = ["testing"], deps = [ ":aemu-host-common-headers", "//base:aemu-base-headers", "@googletest//:gtest", ], ) cc_library( name = "test-headers", hdrs = [ "testing/HostAddressSpace.h", "testing/MockAndroidEmulatorWindowAgent.h", "testing/MockAndroidVmOperations.h", "testing/MockGraphicsAgentFactory.h", ], includes = ["include"], visibility = ["//visibility:public"], deps = ["//base:test-io"], ) # Testing Libraries and Executable (conditional) cc_test( name = "aemu-host-logging_unittests", srcs = [ "logging_absl_unittest.cpp", ], includes = ["testing"], deps = [ ":aemu-host-common-headers", ":logging", ":test-headers", "//base:aemu-base", "//base:aemu-base-allocator", "//base:aemu-base-headers", "//host-common:aemu-host-common", "@abseil-cpp//absl/log", "@abseil-cpp//absl/log:absl_log", "@abseil-cpp//absl/log:globals", "@abseil-cpp//absl/log:initialize", "@abseil-cpp//absl/log:log_sink_registry", "@googletest//:gtest_main", ], )