1 cc_library { 2 name: "libusb", 3 host_supported: true, 4 vendor_available: true, 5 6 srcs: [ 7 "libusb/core.c", 8 "libusb/descriptor.c", 9 "libusb/hotplug.c", 10 "libusb/io.c", 11 "libusb/sync.c", 12 "libusb/strerror.c", 13 ], 14 15 local_include_dirs: [ 16 "libusb", 17 "libusb/os", 18 ], 19 20 cflags: [ 21 "-Wall", 22 "-Wno-error=sign-compare", 23 "-Wno-error=switch", 24 ], 25 26 target: { 27 linux: { 28 srcs: [ 29 "libusb/os/linux_usbfs.c", 30 "libusb/os/poll_posix.c", 31 "libusb/os/threads_posix.c", 32 "libusb/os/linux_netlink.c", 33 ], 34 }, 35 36 android: { 37 local_include_dirs: [ 38 "android", 39 ], 40 41 cflags: ["-Werror"], 42 }, 43 44 darwin: { 45 srcs: [ 46 "libusb/os/darwin_usb.c", 47 "libusb/os/poll_posix.c", 48 "libusb/os/threads_posix.c", 49 ], 50 51 local_include_dirs: [ 52 "darwin", 53 ], 54 55 host_ldlibs: [ 56 "-framework CoreFoundation", 57 "-framework IOKit", 58 "-lobjc" 59 ], 60 61 cflags: [ 62 "-Wno-unused-parameter", 63 "-Wno-deprecated-declarations" 64 ], 65 }, 66 67 linux_glibc: { 68 local_include_dirs: [ 69 "linux", 70 ], 71 72 cflags: ["-Werror"], 73 }, 74 75 windows: { 76 srcs: [ 77 "libusb/os/poll_windows.c", 78 "libusb/os/threads_windows.c", 79 "libusb/os/windows_nt_common.c", 80 "libusb/os/windows_winusb.c", 81 ], 82 83 local_include_dirs: [ 84 "windows", 85 ], 86 87 cflags: [ 88 "-Werror", 89 "-Wno-unused-function", 90 "-Wno-unused-parameter", 91 ], 92 enabled: true, 93 }, 94 }, 95 96 shared_libs: ["liblog"], 97 export_include_dirs: ["include"], 98 } 99 100