| Index: third_party/libusb/libusb.gyp
|
| diff --git a/third_party/libusb/libusb.gyp b/third_party/libusb/libusb.gyp
|
| index 6c5ffd4656d92349bd493d487c2dd36135c77967..4fc0c7e6b9061108b2bff63121ecc54948e48b70 100644
|
| --- a/third_party/libusb/libusb.gyp
|
| +++ b/third_party/libusb/libusb.gyp
|
| @@ -3,63 +3,88 @@
|
| # found in the LICENSE file.
|
|
|
| {
|
| + 'variables': {
|
| + 'use_system_libusb%': 0,
|
| + },
|
| 'targets': [
|
| {
|
| 'target_name': 'libusb',
|
| - 'type': '<(library)',
|
| - 'sources': [
|
| - 'libusb/core.c',
|
| - 'libusb/descriptor.c',
|
| - 'libusb/io.c',
|
| - 'libusb/sync.c',
|
| - ],
|
| - 'include_dirs': [
|
| - '.',
|
| - 'libusb',
|
| - 'libusb/os',
|
| - ],
|
| 'conditions': [
|
| - [ 'OS == "linux"', {
|
| - 'sources': [
|
| - 'libusb/os/linux_usbfs.c',
|
| - 'libusb/os/threads_posix.c',
|
| - ],
|
| - 'defines': [
|
| - 'DEFAULT_VISIBILITY=',
|
| - 'HAVE_POLL_H=1',
|
| - 'HAVE_SYS_TIME_H=1',
|
| - 'OS_LINUX=1',
|
| - 'POLL_NFDS_TYPE=nfds_t',
|
| - 'THREADS_POSIX=1',
|
| - '_GNU_SOURCE=1',
|
| - ],
|
| - }],
|
| - [ 'OS == "win"', {
|
| + ['OS == "linux" and use_system_libusb', {
|
| + 'type': 'none',
|
| + 'direct_dependent_settings': {
|
| + 'defines': [
|
| + 'USE_SYSTEM_LIBUSB',
|
| + ],
|
| + 'cflags': [
|
| + '<!@(pkg-config --cflags libusb-1.0)',
|
| + ],
|
| + 'link_settings': {
|
| + 'ldflags': [
|
| + '<!@(pkg-config --libs-only-L --libs-only-other libusb-1.0)',
|
| + ],
|
| + 'libraries': [
|
| + '<!@(pkg-config --libs-only-l libusb-1.0)',
|
| + ],
|
| + },
|
| + },
|
| + }, {
|
| + 'type': '<(library)',
|
| 'sources': [
|
| - 'libusb/os/poll_windows.c',
|
| - 'libusb/os/threads_windows.c',
|
| - 'libusb/os/windows_usb.c',
|
| - ],
|
| - 'include_dirs!': [
|
| - '.',
|
| + 'src/libusb/core.c',
|
| + 'src/libusb/descriptor.c',
|
| + 'src/libusb/io.c',
|
| + 'src/libusb/sync.c',
|
| ],
|
| 'include_dirs': [
|
| - 'msvc',
|
| - ],
|
| - }],
|
| - [ 'OS == "mac"', {
|
| - 'sources': [
|
| - 'libusb/os/darwin_usb.c',
|
| - 'libusb/os/threads_posix.c',
|
| + 'src',
|
| + 'src/libusb',
|
| + 'src/libusb/os',
|
| ],
|
| - 'defines': [
|
| - 'DEFAULT_VISIBILITY=',
|
| - 'HAVE_POLL_H=1',
|
| - 'HAVE_SYS_TIME_H=1',
|
| - 'OS_DARWIN=1',
|
| - 'POLL_NFDS_TYPE=nfds_t',
|
| - 'THREADS_POSIX=1',
|
| - '_GNU_SOURCE=1',
|
| + 'conditions': [
|
| + [ 'OS == "linux"', {
|
| + 'sources': [
|
| + 'src/libusb/os/linux_usbfs.c',
|
| + 'src/libusb/os/threads_posix.c',
|
| + ],
|
| + 'defines': [
|
| + 'DEFAULT_VISIBILITY=',
|
| + 'HAVE_POLL_H=1',
|
| + 'HAVE_SYS_TIME_H=1',
|
| + 'OS_LINUX=1',
|
| + 'POLL_NFDS_TYPE=nfds_t',
|
| + 'THREADS_POSIX=1',
|
| + '_GNU_SOURCE=1',
|
| + ],
|
| + }],
|
| + ['OS == "win"', {
|
| + 'sources': [
|
| + 'src/libusb/os/poll_windows.c',
|
| + 'src/libusb/os/threads_windows.c',
|
| + 'src/libusb/os/windows_usb.c',
|
| + ],
|
| + 'include_dirs!': [
|
| + 'src',
|
| + ],
|
| + 'include_dirs': [
|
| + 'src/msvc',
|
| + ],
|
| + }],
|
| + ['OS == "mac"', {
|
| + 'sources': [
|
| + 'src/libusb/os/darwin_usb.c',
|
| + 'src/libusb/os/threads_posix.c',
|
| + ],
|
| + 'defines': [
|
| + 'DEFAULT_VISIBILITY=',
|
| + 'HAVE_POLL_H=1',
|
| + 'HAVE_SYS_TIME_H=1',
|
| + 'OS_DARWIN=1',
|
| + 'POLL_NFDS_TYPE=nfds_t',
|
| + 'THREADS_POSIX=1',
|
| + '_GNU_SOURCE=1',
|
| + ],
|
| + }],
|
| ],
|
| }],
|
| ],
|
|
|