aboutsummaryrefslogtreecommitdiff
path: root/base/BUILD.bazel
diff options
context:
space:
mode:
Diffstat (limited to 'base/BUILD.bazel')
-rw-r--r--base/BUILD.bazel141
1 files changed, 141 insertions, 0 deletions
diff --git a/base/BUILD.bazel b/base/BUILD.bazel
new file mode 100644
index 0000000..d199fed
--- /dev/null
+++ b/base/BUILD.bazel
@@ -0,0 +1,141 @@
+# Interface library
+cc_library(
+ name = "aemu-base-headers",
+ hdrs = glob([
+ "include/**/*.h",
+ "include/**/*.hpp",
+ ]),
+ defines = select({
+ "@platforms//os:windows": [
+ "WIN32_LEAN_AND_MEAN",
+ ],
+ "//conditions:default": [],
+ }),
+ includes = ["include"],
+ visibility = ["//visibility:public"],
+ deps = ["//hardware/google/aemu/host-common:aemu-host-common-headers"],
+)
+
+cc_library(
+ name = "aemu-base-metrics",
+ srcs = ["Metrics.cpp"],
+ visibility = ["//visibility:public"],
+ deps = [":aemu-base-headers"],
+)
+
+cc_library(
+ name = "aemu-base-allocator",
+ srcs = ["SubAllocator.cpp"],
+ visibility = ["//visibility:public"],
+ deps = [":aemu-base-headers"],
+)
+
+objc_library(
+ name = "aemu-base-darwin",
+ srcs = [
+ "system-native-mac.mm",
+ ],
+ deps = [":aemu-base-headers"],
+)
+
+cc_library(
+ name = "aemu-base",
+ srcs = [
+ "AlignedBuf.cpp",
+ "CLog.cpp",
+ "CompressingStream.cpp",
+ "CpuTime.cpp",
+ "DecompressingStream.cpp",
+ "FileUtils.cpp",
+ "FunctorThread.cpp",
+ "GLObjectCounter.cpp",
+ "HealthMonitor.cpp",
+ "LayoutResolver.cpp",
+ "MemStream.cpp",
+ "MemoryTracker.cpp",
+ "MessageChannel.cpp",
+ "PathUtils.cpp",
+ "SharedLibrary.cpp",
+ "StdioStream.cpp",
+ "Stream.cpp",
+ "StreamSerializing.cpp",
+ "StringFormat.cpp",
+ "SubAllocator.cpp",
+ "System.cpp",
+ "Tracing.cpp",
+ "ring_buffer.cpp",
+ ] + select({
+ "@platforms//os:windows": [
+ "SharedMemory_win32.cpp",
+ "Thread_win32.cpp",
+ "Win32UnicodeString.cpp",
+ "msvc.cpp",
+ ],
+ "@platforms//os:macos": [
+ "SharedMemory_posix.cpp",
+ "Thread_pthread.cpp",
+ ],
+ "@platforms//os:linux": [
+ "SharedMemory_posix.cpp",
+ "Thread_pthread.cpp",
+ ],
+ }),
+ defines = [
+ "BUILDING_EMUGL_COMMON_SHARED",
+ "LOGGING_API_SHARED",
+ ] + select({
+ "@platforms//os:windows": [
+ "WIN32_LEAN_AND_MEAN",
+ ],
+ "//conditions:default": [],
+ }),
+ linkopts = select({
+ "@platforms//os:linux": [
+ "-ldl",
+ ],
+ "@platforms//os:windows": [
+ "-DEFAULTLIB:Shlwapi.lib",
+ ],
+ "//conditions:default": [],
+ }),
+ visibility = ["//visibility:public"],
+ deps = [
+ ":aemu-base-headers",
+ ":aemu-base-metrics",
+ "//external/lz4",
+ ] + select({
+ "@platforms//os:macos": [
+ ":aemu-base-darwin",
+ ],
+ "//conditions:default": [],
+ }),
+)
+
+cc_test(
+ name = "aemu-base_unittests",
+ srcs = [
+ "AlignedBuf_unittest.cpp",
+ "ArraySize_unittest.cpp",
+ "HealthMonitor_unittest.cpp",
+ "HybridEntityManager_unittest.cpp",
+ "LayoutResolver_unittest.cpp",
+ "LruCache_unittest.cpp",
+ "ManagedDescriptor_unittest.cpp",
+ "Optional_unittest.cpp",
+ "StringFormat_unittest.cpp",
+ "SubAllocator_unittest.cpp",
+ "TypeTraits_unittest.cpp",
+ "WorkerThread_unittest.cpp",
+ "ring_buffer_unittest.cpp",
+ "testing/file_io.cpp",
+ ] + select({
+ "@platforms//os:windows": ["Win32UnicodeString_unittest.cpp"],
+ "//conditions:default": [],
+ }),
+ deps = [
+ ":aemu-base",
+ ":aemu-base-headers",
+ "//hardware/google/aemu/host-common:logging",
+ "@com_google_googletest//:gtest_main",
+ ],
+)