adbd: compile for host.
Preparatory step for testing adb on GCE on non-linux hosts: instead of
pointing them at a device (emulated or otherwise), point them at adbd
running on a linux host instead.
Test: adbd & adb connect localhost:5555; adb -e wait-for-device shell
Change-Id: Ib22d51a4fc9e6e68f71bf1b3b9b2e1b0bd844760
diff --git a/adb/adb_trace.cpp b/adb/adb_trace.cpp
index 2bd6a3e..80f146c 100644
--- a/adb/adb_trace.cpp
+++ b/adb/adb_trace.cpp
@@ -32,7 +32,9 @@
#if !ADB_HOST
const char* adb_device_banner = "device";
+#if defined(__ANDROID__)
static android::base::LogdLogger gLogdLogger;
+#endif
#else
const char* adb_device_banner = "host";
#endif
@@ -46,7 +48,7 @@
fflush(stderr);
#endif
-#if !ADB_HOST
+#if !ADB_HOST && defined(__ANDROID__)
// Only print logs of INFO or higher to logcat, so that `adb logcat` with adbd tracing on
// doesn't result in exponential logging.
if (severity >= android::base::INFO) {