diff options
author | Dan Willemsen <dwillemsen@google.com> | 2017-09-08 22:47:47 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2017-09-09 06:18:48 +0000 |
commit | d3eac266b02399a8a822517e844c05585879221a (patch) | |
tree | 9d6cefd142dd515c9e3ad946f6549f9727822c8e /libs/usb | |
parent | 1cb5ab2dc14fb35359525479a7c7356d84904ce1 (diff) |
Convert host tools to Android.bp
See build/soong/README.md for more information.
Test: m libinstrumentation interrupter accessorychat accessorytest bit obbtool pbkdf2gen libsplit-select_tests split-select protoc-gen-javastream validatekeymaps libaapt_tests aapt
Test: mmma frameworks/base
Test: out/host/linux-x86/nativetest64/libaapt_tests/libaapt_tests
Test: out/host/linux-x86/nativetest64/libsplit-select_tests/libsplit-select_tests
Change-Id: I93cf24d4b232353a52d53be8ed85781b8f4a3877
Diffstat (limited to 'libs/usb')
-rw-r--r-- | libs/usb/Android.bp | 1 | ||||
-rw-r--r-- | libs/usb/tests/AccessoryChat/Android.bp | 1 | ||||
-rw-r--r-- | libs/usb/tests/AccessoryChat/accessorychat/Android.bp | 30 | ||||
-rw-r--r-- | libs/usb/tests/AccessoryChat/accessorychat/Android.mk | 35 | ||||
-rw-r--r-- | libs/usb/tests/accessorytest/Android.bp | 28 | ||||
-rw-r--r-- | libs/usb/tests/accessorytest/Android.mk | 25 | ||||
-rw-r--r-- | libs/usb/tests/accessorytest/accessory.h | 2 | ||||
-rw-r--r-- | libs/usb/tests/accessorytest/hid.c | 2 | ||||
-rw-r--r-- | libs/usb/tests/accessorytest/usb.c | 2 |
9 files changed, 63 insertions, 63 deletions
diff --git a/libs/usb/Android.bp b/libs/usb/Android.bp new file mode 100644 index 000000000000..b8f29043e597 --- /dev/null +++ b/libs/usb/Android.bp @@ -0,0 +1 @@ +subdirs = ["tests/*"] diff --git a/libs/usb/tests/AccessoryChat/Android.bp b/libs/usb/tests/AccessoryChat/Android.bp new file mode 100644 index 000000000000..4af6274b7ece --- /dev/null +++ b/libs/usb/tests/AccessoryChat/Android.bp @@ -0,0 +1 @@ +subdirs = ["accessorychat"] diff --git a/libs/usb/tests/AccessoryChat/accessorychat/Android.bp b/libs/usb/tests/AccessoryChat/accessorychat/Android.bp new file mode 100644 index 000000000000..5613745e966b --- /dev/null +++ b/libs/usb/tests/AccessoryChat/accessorychat/Android.bp @@ -0,0 +1,30 @@ +cc_binary { + name: "accessorychat", + host_supported: true, + + srcs: ["accessorychat.c"], + cflags: [ + "-Werror", + "-Wno-unused-parameter", + ], + + target: { + android: { + shared_libs: [ + "libusbhost", + "libcutils", + ], + }, + host: { + static_libs: [ + "libusbhost", + "libcutils", + ], + + cflags: ["-O0"], + }, + darwin: { + enabled: false, + }, + }, +} diff --git a/libs/usb/tests/AccessoryChat/accessorychat/Android.mk b/libs/usb/tests/AccessoryChat/accessorychat/Android.mk deleted file mode 100644 index 51f2111f1e0b..000000000000 --- a/libs/usb/tests/AccessoryChat/accessorychat/Android.mk +++ /dev/null @@ -1,35 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -# Build for Linux (desktop) host -ifeq ($(HOST_OS),linux) - -include $(CLEAR_VARS) -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk - -LOCAL_MODULE_TAGS := optional - -LOCAL_SRC_FILES := accessorychat.c - -LOCAL_MODULE := accessorychat - -LOCAL_STATIC_LIBRARIES := libusbhost libcutils -LOCAL_LDLIBS += -lpthread -LOCAL_CFLAGS := -g -O0 - -include $(BUILD_HOST_EXECUTABLE) - -endif - -# Build for device -include $(CLEAR_VARS) -LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk - -LOCAL_MODULE_TAGS := optional - -LOCAL_SRC_FILES := accessorychat.c - -LOCAL_MODULE := accessorychat - -LOCAL_SHARED_LIBRARIES := libusbhost libcutils - -include $(BUILD_EXECUTABLE) diff --git a/libs/usb/tests/accessorytest/Android.bp b/libs/usb/tests/accessorytest/Android.bp new file mode 100644 index 000000000000..c6340e32e60c --- /dev/null +++ b/libs/usb/tests/accessorytest/Android.bp @@ -0,0 +1,28 @@ +cc_binary_host { + name: "accessorytest", + + srcs: [ + "accessory.c", + "audio.c", + "hid.c", + "usb.c", + ], + + static_libs: [ + "libusbhost", + "libcutils", + "libtinyalsa", + ], + cflags: [ + "-O0", + "-Wno-unused-parameter", + "-Werror", + ], + + target: { + darwin: { + // Build for Linux host only + enabled: false, + }, + }, +} diff --git a/libs/usb/tests/accessorytest/Android.mk b/libs/usb/tests/accessorytest/Android.mk deleted file mode 100644 index 6d9a9460c675..000000000000 --- a/libs/usb/tests/accessorytest/Android.mk +++ /dev/null @@ -1,25 +0,0 @@ -LOCAL_PATH:= $(call my-dir) - -# Build for Linux host only -ifeq ($(HOST_OS),linux) - -include $(CLEAR_VARS) - -LOCAL_MODULE_TAGS := optional - -LOCAL_SRC_FILES := accessory.c \ - audio.c \ - hid.c \ - usb.c - -LOCAL_C_INCLUDES += external/tinyalsa/include - -LOCAL_MODULE := accessorytest - -LOCAL_STATIC_LIBRARIES := libusbhost libcutils libtinyalsa -LOCAL_LDLIBS += -lpthread -LOCAL_CFLAGS := -g -O0 - -include $(BUILD_HOST_EXECUTABLE) - -endif diff --git a/libs/usb/tests/accessorytest/accessory.h b/libs/usb/tests/accessorytest/accessory.h index 55c4550f79e0..e86986eb403f 100644 --- a/libs/usb/tests/accessorytest/accessory.h +++ b/libs/usb/tests/accessorytest/accessory.h @@ -19,7 +19,7 @@ int init_audio(unsigned int ic, unsigned int id, unsigned int oc, unsigned int od); void init_hid(); -void usb_run(int enable_accessory); +void usb_run(uintptr_t enable_accessory); struct usb_device* usb_wait_for_device(); diff --git a/libs/usb/tests/accessorytest/hid.c b/libs/usb/tests/accessorytest/hid.c index b70d678543ca..283755dbf215 100644 --- a/libs/usb/tests/accessorytest/hid.c +++ b/libs/usb/tests/accessorytest/hid.c @@ -139,7 +139,7 @@ static void open_hid(const char* name) fprintf(stderr, "opened /dev/%s\n", name); pthread_t th; - pthread_create(&th, NULL, hid_thread, (void *)fd); + pthread_create(&th, NULL, hid_thread, (void *)(uintptr_t)fd); } static void* inotify_thread(void* arg) diff --git a/libs/usb/tests/accessorytest/usb.c b/libs/usb/tests/accessorytest/usb.c index ac72b35b908e..1a161adf8ac2 100644 --- a/libs/usb/tests/accessorytest/usb.c +++ b/libs/usb/tests/accessorytest/usb.c @@ -219,7 +219,7 @@ struct usb_device* usb_wait_for_device() { return device; } -void usb_run(int enable_accessory) { +void usb_run(uintptr_t enable_accessory) { struct usb_host_context* context = usb_host_init(); usb_host_run(context, usb_device_added, usb_device_removed, NULL, (void *)enable_accessory); |