Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 1 | cc_library { |
| 2 | name: "libusb", |
| 3 | host_supported: true, |
Steven Moreland | 730a62e | 2018-01-08 14:41:29 -0800 | [diff] [blame] | 4 | vendor_available: true, |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 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 | |
Chih-Hung Hsieh | f0237de | 2017-10-11 11:07:16 -0700 | [diff] [blame] | 20 | cflags: [ |
| 21 | "-Wall", |
| 22 | "-Wno-error=sign-compare", |
| 23 | "-Wno-error=switch", |
| 24 | ], |
| 25 | |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 26 | target: { |
Dan Willemsen | 8471621 | 2017-10-03 14:16:21 -0700 | [diff] [blame] | 27 | linux: { |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 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 | ], |
Dan Willemsen | 8471621 | 2017-10-03 14:16:21 -0700 | [diff] [blame] | 34 | }, |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 35 | |
Dan Willemsen | 8471621 | 2017-10-03 14:16:21 -0700 | [diff] [blame] | 36 | android: { |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 37 | local_include_dirs: [ |
| 38 | "android", |
| 39 | ], |
Chih-Hung Hsieh | f0237de | 2017-10-11 11:07:16 -0700 | [diff] [blame] | 40 | |
| 41 | cflags: ["-Werror"], |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 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 | ], |
Chih-Hung Hsieh | f0237de | 2017-10-11 11:07:16 -0700 | [diff] [blame] | 60 | |
Stephen Hines | 0c8dc90 | 2017-11-21 09:45:04 -0800 | [diff] [blame] | 61 | cflags: [ |
| 62 | "-Wno-unused-parameter", |
| 63 | "-Wno-deprecated-declarations" |
| 64 | ], |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 65 | }, |
| 66 | |
Dan Willemsen | 343ff5b | 2017-10-02 10:41:09 -0700 | [diff] [blame] | 67 | linux_glibc: { |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 68 | local_include_dirs: [ |
| 69 | "linux", |
| 70 | ], |
Chih-Hung Hsieh | f0237de | 2017-10-11 11:07:16 -0700 | [diff] [blame] | 71 | |
| 72 | cflags: ["-Werror"], |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 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", |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 80 | "libusb/os/windows_winusb.c", |
| 81 | ], |
| 82 | |
| 83 | local_include_dirs: [ |
| 84 | "windows", |
| 85 | ], |
| 86 | |
Pirama Arumuga Nainar | 39c92d1 | 2018-06-25 13:32:51 -0700 | [diff] [blame] | 87 | cflags: [ |
| 88 | "-Werror", |
| 89 | "-Wno-unused-function", |
| 90 | "-Wno-unused-parameter", |
| 91 | ], |
Josh Gao | ce17193 | 2017-12-08 13:01:53 -0800 | [diff] [blame] | 92 | enabled: true, |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 93 | }, |
| 94 | }, |
| 95 | |
| 96 | shared_libs: ["liblog"], |
| 97 | export_include_dirs: ["include"], |
| 98 | } |
| 99 | |