Fix compile error

Test: build on Linux with CC=clang CXX=clang++ cmake . ../ -G Ninja -D VIRGL_RENDERER_UNSTABLE_APIS=ON
Change-Id: Iaf0c32c6fd570e3efbe4bf9d9bd8998900922a49
diff --git a/base/CMakeLists.txt b/base/CMakeLists.txt
index 978b721..81a1bcc 100644
--- a/base/CMakeLists.txt
+++ b/base/CMakeLists.txt
@@ -44,22 +44,10 @@
         ${gfxstream-base-posix-sources})
 endif()
 
-if (RECORDER_DELEGATE_LIB)
-    set(gfxstream-base-metrics-sources
-        MetricsRecorderDelegate.cpp)
-    set(gfxstream-base-metrics-link-libraries
-        recorder_delegate_lib)
-else()
-    set(gfxstream-base-metrics-sources
-        MetricsNoOp.cpp)
-    set(gfxstream-base-metrics-link-libraries)
-endif()
-
 add_library(
     gfxstream-base
     ${gfxstream-base-common-sources}
-    ${gfxstream-platform-sources}
-    ${gfxstream-base-metrics-sources})
+    ${gfxstream-platform-sources})
 
 if (WIN32)
     set(gfxstream-base-platform-deps "")
@@ -72,8 +60,7 @@
     PRIVATE
     lz4
     perfetto-tracing-only
-    ${gfxstream-base-platform-deps}
-    ${gfxstream-base-metrics-link-libraries})
+    ${gfxstream-base-platform-deps})
 
 target_include_directories(
     gfxstream-base PUBLIC ${GFXSTREAM_REPO_ROOT})
diff --git a/host-common/CMakeLists.txt b/host-common/CMakeLists.txt
index c3d6241..423d8fd 100644
--- a/host-common/CMakeLists.txt
+++ b/host-common/CMakeLists.txt
@@ -10,16 +10,32 @@
         opengl/NativeGpuInfo_linux.cpp)
 endif()
 
+if (RECORDER_DELEGATE_LIB)
+    set(gfxstream-base-metrics-sources
+        ../base/MetricsRecorderDelegate.cpp)
+    set(gfxstream-base-metrics-link-libraries
+        recorder_delegate_lib)
+else()
+    set(gfxstream-base-metrics-sources
+        ../base/MetricsNoOp.cpp)
+    set(gfxstream-base-metrics-link-libraries)
+endif()
+
 # TODO(gregschlom) move this to base
 add_library(logging-base
     STATIC
     logging.cpp
-    GfxstreamFatalError.cpp)
+    GfxstreamFatalError.cpp
+    ${gfxstream-base-metrics-sources})
 target_include_directories(
     logging-base
     PRIVATE
     ${GFXSTREAM_REPO_ROOT}
     ${GFXSTREAM_REPO_ROOT}/include)
+target_link_libraries(
+    logging-base
+    PRIVATE
+    ${gfxstream-base-metrics-link-libraries})
 
 add_library(
     gfxstream-host-common