summaryrefslogtreecommitdiffstats
path: root/adb/Android.mk
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-04-19 13:17:01 -0700
committerElliott Hughes <enh@google.com>2015-04-19 13:17:01 -0700
commit53daee6a2b415caa0ff3e425c7fa613c834bca61 (patch)
tree24950c9510a1bb8dfa6317c630c391a9b7bfdf6f /adb/Android.mk
parent623aa1c47a51990259fbbc271d7f9f40046153fd (diff)
downloadsystem_core-53daee6a2b415caa0ff3e425c7fa613c834bca61.zip
system_core-53daee6a2b415caa0ff3e425c7fa613c834bca61.tar.gz
system_core-53daee6a2b415caa0ff3e425c7fa613c834bca61.tar.bz2
Fix the Windows adb build.
It looks like we can't use clang on Windows yet because libc++ isn't ready. So move back to GCC for the Windows host clang. Work around the mingw printf format string problems that made us want to switch to clang in the first place, and #include "sysdeps.h" in adb_utils.cpp to work around the absence of lstat(2) on Windows. Change-Id: Icd0797a8c0c2d1d326bdd704ba6bcafcbaeb742f
Diffstat (limited to 'adb/Android.mk')
-rw-r--r--adb/Android.mk37
1 files changed, 17 insertions, 20 deletions
diff --git a/adb/Android.mk b/adb/Android.mk
index 2ea89e9..f0117d3 100644
--- a/adb/Android.mk
+++ b/adb/Android.mk
@@ -5,7 +5,11 @@
LOCAL_PATH:= $(call my-dir)
-ADB_CLANG := true
+ifeq ($(HOST_OS),windows)
+ adb_host_clang := false # libc++ for mingw not ready yet.
+else
+ adb_host_clang := true
+endif
# libadb
# =========================================================
@@ -27,6 +31,11 @@ LIBADB_SRC_FILES := \
transport_local.cpp \
transport_usb.cpp \
+LIBADB_TEST_SRCS := \
+ adb_io_test.cpp \
+ adb_utils_test.cpp \
+ transport_test.cpp \
+
LIBADB_CFLAGS := \
-Wall -Werror \
-Wno-unused-parameter \
@@ -63,7 +72,7 @@ LOCAL_SRC_FILES := \
include $(BUILD_STATIC_LIBRARY)
include $(CLEAR_VARS)
-LOCAL_CLANG := $(ADB_CLANG)
+LOCAL_CLANG := $(adb_host_clang)
LOCAL_MODULE := libadb
LOCAL_CFLAGS := $(LIBADB_CFLAGS) -DADB_HOST=1
LOCAL_SRC_FILES := \
@@ -81,13 +90,8 @@ endif
include $(BUILD_HOST_STATIC_LIBRARY)
-LIBADB_TEST_SRCS := \
- adb_io_test.cpp \
- adb_utils_test.cpp \
- transport_test.cpp \
-
include $(CLEAR_VARS)
-LOCAL_CLANG := $(ADB_CLANG)
+LOCAL_CLANG := true
LOCAL_MODULE := adbd_test
LOCAL_CFLAGS := -DADB_HOST=0 $(LIBADB_CFLAGS)
LOCAL_SRC_FILES := $(LIBADB_TEST_SRCS)
@@ -96,7 +100,7 @@ LOCAL_SHARED_LIBRARIES := liblog libbase libcutils
include $(BUILD_NATIVE_TEST)
include $(CLEAR_VARS)
-LOCAL_CLANG := $(ADB_CLANG)
+LOCAL_CLANG := $(adb_host_clang)
LOCAL_MODULE := adb_test
LOCAL_CFLAGS := -DADB_HOST=1 $(LIBADB_CFLAGS)
LOCAL_SRC_FILES := $(LIBADB_TEST_SRCS) services.cpp
@@ -131,15 +135,11 @@ ifeq ($(HOST_OS),darwin)
endif
ifeq ($(HOST_OS),windows)
+ LOCAL_LDLIBS += -lws2_32 -lgdi32
EXTRA_STATIC_LIBS := AdbWinApi
- ifneq ($(strip $(USE_MINGW)),)
- # MinGW under Linux case
- LOCAL_LDLIBS += -lws2_32 -lgdi32
- USE_SYSDEPS_WIN32 := 1
- endif
endif
-LOCAL_CLANG := $(ADB_CLANG)
+LOCAL_CLANG := $(adb_host_clang)
LOCAL_SRC_FILES := \
adb_main.cpp \
@@ -162,12 +162,9 @@ LOCAL_STATIC_LIBRARIES := \
libadb \
libbase \
libcrypto_static \
+ libcutils \
$(EXTRA_STATIC_LIBS) \
-ifeq ($(USE_SYSDEPS_WIN32),)
- LOCAL_STATIC_LIBRARIES += libcutils
-endif
-
include $(BUILD_HOST_EXECUTABLE)
$(call dist-for-goals,dist_files sdk,$(LOCAL_BUILT_MODULE))
@@ -184,7 +181,7 @@ endif
include $(CLEAR_VARS)
-LOCAL_CLANG := $(ADB_CLANG)
+LOCAL_CLANG := true
LOCAL_SRC_FILES := \
adb_main.cpp \