Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 1 | cc_library { |
| 2 | name: "libusb", |
| 3 | host_supported: true, |
| 4 | |
| 5 | srcs: [ |
| 6 | "libusb/core.c", |
| 7 | "libusb/descriptor.c", |
| 8 | "libusb/hotplug.c", |
| 9 | "libusb/io.c", |
| 10 | "libusb/sync.c", |
| 11 | "libusb/strerror.c", |
| 12 | ], |
| 13 | |
| 14 | local_include_dirs: [ |
| 15 | "libusb", |
| 16 | "libusb/os", |
| 17 | ], |
| 18 | |
Chih-Hung Hsieh | f0237de | 2017-10-11 11:07:16 -0700 | [diff] [blame] | 19 | cflags: [ |
| 20 | "-Wall", |
| 21 | "-Wno-error=sign-compare", |
| 22 | "-Wno-error=switch", |
| 23 | ], |
| 24 | |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 25 | target: { |
Dan Willemsen | 8471621 | 2017-10-03 14:16:21 -0700 | [diff] [blame] | 26 | linux: { |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 27 | srcs: [ |
| 28 | "libusb/os/linux_usbfs.c", |
| 29 | "libusb/os/poll_posix.c", |
| 30 | "libusb/os/threads_posix.c", |
| 31 | "libusb/os/linux_netlink.c", |
| 32 | ], |
Dan Willemsen | 8471621 | 2017-10-03 14:16:21 -0700 | [diff] [blame] | 33 | }, |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 34 | |
Dan Willemsen | 8471621 | 2017-10-03 14:16:21 -0700 | [diff] [blame] | 35 | android: { |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 36 | local_include_dirs: [ |
| 37 | "android", |
| 38 | ], |
Chih-Hung Hsieh | f0237de | 2017-10-11 11:07:16 -0700 | [diff] [blame] | 39 | |
| 40 | cflags: ["-Werror"], |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 41 | }, |
| 42 | |
| 43 | darwin: { |
| 44 | srcs: [ |
| 45 | "libusb/os/darwin_usb.c", |
| 46 | "libusb/os/poll_posix.c", |
| 47 | "libusb/os/threads_posix.c", |
| 48 | ], |
| 49 | |
| 50 | local_include_dirs: [ |
| 51 | "darwin", |
| 52 | ], |
| 53 | |
| 54 | host_ldlibs: [ |
| 55 | "-framework CoreFoundation", |
| 56 | "-framework IOKit", |
| 57 | "-lobjc" |
| 58 | ], |
Chih-Hung Hsieh | f0237de | 2017-10-11 11:07:16 -0700 | [diff] [blame] | 59 | |
Stephen Hines | 0c8dc90 | 2017-11-21 09:45:04 -0800 | [diff] [blame^] | 60 | cflags: [ |
| 61 | "-Wno-unused-parameter", |
| 62 | "-Wno-deprecated-declarations" |
| 63 | ], |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 64 | }, |
| 65 | |
Dan Willemsen | 343ff5b | 2017-10-02 10:41:09 -0700 | [diff] [blame] | 66 | linux_glibc: { |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 67 | local_include_dirs: [ |
| 68 | "linux", |
| 69 | ], |
Chih-Hung Hsieh | f0237de | 2017-10-11 11:07:16 -0700 | [diff] [blame] | 70 | |
| 71 | cflags: ["-Werror"], |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 72 | }, |
| 73 | |
| 74 | windows: { |
| 75 | srcs: [ |
| 76 | "libusb/os/poll_windows.c", |
| 77 | "libusb/os/threads_windows.c", |
| 78 | "libusb/os/windows_nt_common.c", |
| 79 | "libusb/os/windows_usbdk.c", |
| 80 | "libusb/os/windows_winusb.c", |
| 81 | ], |
| 82 | |
| 83 | local_include_dirs: [ |
| 84 | "windows", |
| 85 | ], |
| 86 | |
Chih-Hung Hsieh | f0237de | 2017-10-11 11:07:16 -0700 | [diff] [blame] | 87 | cflags: ["-Werror"], |
| 88 | |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 89 | // Not working yet. |
| 90 | enabled: false, |
| 91 | }, |
| 92 | }, |
| 93 | |
| 94 | shared_libs: ["liblog"], |
| 95 | export_include_dirs: ["include"], |
| 96 | } |
| 97 | |