Make ADB over mDNS work on Windows
Test: Verified ADB over mDNS on a Windows machine
Bug: 30482671
(cherry picked from 9fdd77101f49d03ff29342e12e23edf241f68522)
Change-Id: If955ca304db71a5b08c5a9654f1e27ab74af9af8
diff --git a/adb/Android.mk b/adb/Android.mk
index b12a9f8..8a43e37 100644
--- a/adb/Android.mk
+++ b/adb/Android.mk
@@ -144,22 +144,19 @@
LOCAL_CFLAGS_darwin := $(LIBADB_darwin_CFLAGS)
LOCAL_SRC_FILES := \
$(LIBADB_SRC_FILES) \
- adb_auth_host.cpp
+ adb_auth_host.cpp \
+ transport_mdns.cpp \
LOCAL_SRC_FILES_darwin := $(LIBADB_darwin_SRC_FILES)
LOCAL_SRC_FILES_linux := $(LIBADB_linux_SRC_FILES)
LOCAL_SRC_FILES_windows := $(LIBADB_windows_SRC_FILES)
-LOCAL_SRC_FILES_linux += transport_mdns.cpp
-LOCAL_SRC_FILES_darwin += transport_mdns.cpp
-LOCAL_SRC_FILES_windows += transport_mdns_unsupported.cpp
-
LOCAL_SANITIZE := $(adb_host_sanitize)
# Even though we're building a static library (and thus there's no link step for
# this to take effect), this adds the includes to our path.
-LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase
-LOCAL_STATIC_LIBRARIES_linux := libusb libmdnssd
+LOCAL_STATIC_LIBRARIES := libcrypto_utils libcrypto libbase libmdnssd
+LOCAL_STATIC_LIBRARIES_linux := libusb
LOCAL_STATIC_LIBRARIES_darwin := libusb
LOCAL_C_INCLUDES_windows := development/host/windows/usb/api/
@@ -180,7 +177,7 @@
shell_service_test.cpp \
LOCAL_SANITIZE := $(adb_target_sanitize)
-LOCAL_STATIC_LIBRARIES := libadbd libcrypto_utils libcrypto libusb
+LOCAL_STATIC_LIBRARIES := libadbd libcrypto_utils libcrypto libusb libmdnssd
LOCAL_SHARED_LIBRARIES := liblog libbase libcutils
include $(BUILD_NATIVE_TEST)
@@ -228,9 +225,10 @@
libcrypto \
libcutils \
libdiagnose_usb \
+ libmdnssd \
libgmock_host
-LOCAL_STATIC_LIBRARIES_linux := libusb libmdnssd
+LOCAL_STATIC_LIBRARIES_linux := libusb
LOCAL_STATIC_LIBRARIES_darwin := libusb
# Set entrypoint to wmain from sysdeps_win32.cpp instead of main
@@ -295,11 +293,12 @@
libcrypto_utils \
libcrypto \
libdiagnose_usb \
- liblog
+ liblog \
+ libmdnssd
# Don't use libcutils on Windows.
LOCAL_STATIC_LIBRARIES_darwin := libcutils
-LOCAL_STATIC_LIBRARIES_linux := libcutils libmdnssd
+LOCAL_STATIC_LIBRARIES_linux := libcutils
LOCAL_STATIC_LIBRARIES_darwin += libusb
LOCAL_STATIC_LIBRARIES_linux += libusb