Bob Badour | 1a844a6 | 2021-02-12 20:34:37 -0800 | [diff] [blame] | 1 | package { |
| 2 | default_applicable_licenses: ["external_libusb_license"], |
| 3 | } |
| 4 | |
| 5 | // Added automatically by a large-scale-change that took the approach of |
| 6 | // 'apply every license found to every target'. While this makes sure we respect |
| 7 | // every license restriction, it may not be entirely correct. |
| 8 | // |
| 9 | // e.g. GPL in an MIT project might only apply to the contrib/ directory. |
| 10 | // |
| 11 | // Please consider splitting the single license below into multiple licenses, |
| 12 | // taking care not to lose any license_kind information, and overriding the |
| 13 | // default license using the 'licenses: [...]' property on targets as needed. |
| 14 | // |
| 15 | // For unused files, consider creating a 'fileGroup' with "//visibility:private" |
| 16 | // to attach the license to, and including a comment whether the files may be |
| 17 | // used in the current project. |
| 18 | // |
| 19 | // large-scale-change included anything that looked like it might be a license |
| 20 | // text as a license_text. e.g. LICENSE, NOTICE, COPYING etc. |
| 21 | // |
| 22 | // Please consider removing redundant or irrelevant files from 'license_text:'. |
| 23 | // See: http://go/android-license-faq |
| 24 | license { |
| 25 | name: "external_libusb_license", |
| 26 | visibility: [":__subpackages__"], |
| 27 | license_kinds: [ |
| 28 | "SPDX-license-identifier-GPL", |
| 29 | "SPDX-license-identifier-LGPL", |
| 30 | "SPDX-license-identifier-LGPL-2.1", |
| 31 | "SPDX-license-identifier-LGPL-3.0", |
| 32 | "SPDX-license-identifier-MIT", |
| 33 | ], |
| 34 | license_text: [ |
| 35 | "COPYING", |
| 36 | "NOTICE", |
| 37 | ], |
| 38 | } |
| 39 | |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 40 | cc_library { |
| 41 | name: "libusb", |
| 42 | host_supported: true, |
Steven Moreland | 730a62e | 2018-01-08 14:41:29 -0800 | [diff] [blame] | 43 | vendor_available: true, |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 44 | |
| 45 | srcs: [ |
| 46 | "libusb/core.c", |
| 47 | "libusb/descriptor.c", |
| 48 | "libusb/hotplug.c", |
| 49 | "libusb/io.c", |
| 50 | "libusb/sync.c", |
| 51 | "libusb/strerror.c", |
| 52 | ], |
| 53 | |
| 54 | local_include_dirs: [ |
| 55 | "libusb", |
| 56 | "libusb/os", |
| 57 | ], |
| 58 | |
Chih-Hung Hsieh | f0237de | 2017-10-11 11:07:16 -0700 | [diff] [blame] | 59 | cflags: [ |
| 60 | "-Wall", |
| 61 | "-Wno-error=sign-compare", |
| 62 | "-Wno-error=switch", |
Josh Gao | fb28186 | 2020-03-18 14:12:36 -0700 | [diff] [blame] | 63 | "-Wno-error=unused-function", |
| 64 | "-Wno-unused-parameter", |
Chih-Hung Hsieh | f0237de | 2017-10-11 11:07:16 -0700 | [diff] [blame] | 65 | ], |
| 66 | |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 67 | target: { |
Dan Willemsen | 8471621 | 2017-10-03 14:16:21 -0700 | [diff] [blame] | 68 | linux: { |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 69 | srcs: [ |
Haibo Huang | 80719bb | 2020-12-10 22:43:09 -0800 | [diff] [blame] | 70 | "libusb/os/events_posix.c", |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 71 | "libusb/os/linux_usbfs.c", |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 72 | "libusb/os/threads_posix.c", |
| 73 | "libusb/os/linux_netlink.c", |
| 74 | ], |
Dan Willemsen | 8471621 | 2017-10-03 14:16:21 -0700 | [diff] [blame] | 75 | }, |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 76 | |
Dan Willemsen | 8471621 | 2017-10-03 14:16:21 -0700 | [diff] [blame] | 77 | android: { |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 78 | local_include_dirs: [ |
| 79 | "android", |
| 80 | ], |
Chih-Hung Hsieh | f0237de | 2017-10-11 11:07:16 -0700 | [diff] [blame] | 81 | |
| 82 | cflags: ["-Werror"], |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 83 | }, |
| 84 | |
| 85 | darwin: { |
| 86 | srcs: [ |
Haibo Huang | 80719bb | 2020-12-10 22:43:09 -0800 | [diff] [blame] | 87 | "libusb/os/events_posix.c", |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 88 | "libusb/os/darwin_usb.c", |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 89 | "libusb/os/threads_posix.c", |
| 90 | ], |
| 91 | |
| 92 | local_include_dirs: [ |
| 93 | "darwin", |
| 94 | ], |
| 95 | |
| 96 | host_ldlibs: [ |
| 97 | "-framework CoreFoundation", |
| 98 | "-framework IOKit", |
| 99 | "-lobjc" |
| 100 | ], |
Chih-Hung Hsieh | f0237de | 2017-10-11 11:07:16 -0700 | [diff] [blame] | 101 | |
Stephen Hines | 0c8dc90 | 2017-11-21 09:45:04 -0800 | [diff] [blame] | 102 | cflags: [ |
Jiyong Park | 11fb88c | 2021-01-22 08:27:21 +0900 | [diff] [blame] | 103 | "-Wno-deprecated-declarations", |
| 104 | "-Wno-unguarded-availability", |
Stephen Hines | 0c8dc90 | 2017-11-21 09:45:04 -0800 | [diff] [blame] | 105 | ], |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 106 | }, |
| 107 | |
Colin Cross | 1add6d6 | 2022-03-08 15:12:47 -0800 | [diff] [blame] | 108 | host_linux: { |
Jiyong Park | 7163b06 | 2020-08-20 18:05:28 +0900 | [diff] [blame] | 109 | local_include_dirs: [ |
| 110 | "linux", |
| 111 | ], |
| 112 | |
| 113 | cflags: ["-Werror"], |
| 114 | }, |
| 115 | |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 116 | windows: { |
| 117 | srcs: [ |
Haibo Huang | 80719bb | 2020-12-10 22:43:09 -0800 | [diff] [blame] | 118 | "libusb/os/events_windows.c", |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 119 | "libusb/os/threads_windows.c", |
Haibo Huang | 80719bb | 2020-12-10 22:43:09 -0800 | [diff] [blame] | 120 | "libusb/os/windows_common.c", |
Josh Gao | fb28186 | 2020-03-18 14:12:36 -0700 | [diff] [blame] | 121 | "libusb/os/windows_usbdk.c", |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 122 | "libusb/os/windows_winusb.c", |
| 123 | ], |
| 124 | |
| 125 | local_include_dirs: [ |
| 126 | "windows", |
| 127 | ], |
| 128 | |
Pirama Arumuga Nainar | 39c92d1 | 2018-06-25 13:32:51 -0700 | [diff] [blame] | 129 | cflags: [ |
Josh Gao | fb28186 | 2020-03-18 14:12:36 -0700 | [diff] [blame] | 130 | "-Wno-error=pragma-pack", |
| 131 | "-Wno-error=missing-field-initializers", |
| 132 | "-Wno-error=ignored-attributes", |
Pirama Arumuga Nainar | 39c92d1 | 2018-06-25 13:32:51 -0700 | [diff] [blame] | 133 | ], |
Josh Gao | fb28186 | 2020-03-18 14:12:36 -0700 | [diff] [blame] | 134 | |
Josh Gao | ce17193 | 2017-12-08 13:01:53 -0800 | [diff] [blame] | 135 | enabled: true, |
Josh Gao | 4043c2b | 2016-09-26 19:05:16 -0700 | [diff] [blame] | 136 | }, |
| 137 | }, |
| 138 | |
| 139 | shared_libs: ["liblog"], |
| 140 | export_include_dirs: ["include"], |
| 141 | } |