Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1378)

Unified Diff: third_party/libusb/libusb.gyp

Issue 10332075: Adding use_system_libusb option for third_party/libusb (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing license check. Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/libusb/libusb.gyp
diff --git a/third_party/libusb/libusb.gyp b/third_party/libusb/libusb.gyp
index 6c5ffd4656d92349bd493d487c2dd36135c77967..7fb333152cd946666aff9ea90b7e9727e5ea1d65 100644
--- a/third_party/libusb/libusb.gyp
+++ b/third_party/libusb/libusb.gyp
@@ -3,63 +3,90 @@
# found in the LICENSE file.
{
+ 'variables': {
+ 'use_system_libusb%': 0,
+ 'required_libusb_version': '1.0.0',
Paweł Hajdan Jr. 2012/05/10 06:36:15 nit: This is not so much needed, because the lates
Garret Kelly 2012/05/10 17:44:01 Done.
+ },
'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 --atleast-version=<(required_libusb_version) libusb-1.0)',
+ '<!@(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',
+ ],
+ }],
],
}],
],

Powered by Google App Engine
This is Rietveld 408576698