forked from node-usb/node-usb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
binding.gyp
91 lines (90 loc) · 2.33 KB
/
binding.gyp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
{
'variables': {
'use_udev%': 1,
'use_system_libusb%': 'false',
},
'targets': [
{
"target_name": "action_after_build",
"type": "none",
"dependencies": [ "<(module_name)" ],
"copies": [
{
"files": [ "<(PRODUCT_DIR)/<(module_name).node" ],
"destination": "<(module_path)"
}
]
},
{
'target_name': 'usb_bindings',
'sources': [
'./src/node_usb.cc',
'./src/device.cc',
'./src/transfer.cc',
],
'cflags_cc': [
'-std=c++0x'
],
'defines': [
'_FILE_OFFSET_BITS=64',
'_LARGEFILE_SOURCE',
],
'include_dirs+': [
'src/',
"<!(node -e \"require('nan')\")",
],
'conditions' : [
['use_system_libusb=="false"', {
'dependencies': [
'libusb.gypi:libusb',
],
}],
['use_system_libusb=="true"', {
'include_dirs+': [
'<!@(pkg-config libusb-1.0 --cflags-only-I | sed s/-I//g)'
],
'libraries': [
'<!@(pkg-config libusb-1.0 --libs)'
],
}],
['OS=="mac"', {
'xcode_settings': {
'OTHER_CFLAGS': [ '--std=c++1y' ],
'OTHER_LDFLAGS': [ '-framework', 'CoreFoundation', '-framework', 'IOKit' ],
'SDKROOT': 'macosx',
'MACOSX_DEPLOYMENT_TARGET': '10.5',
},
}],
['OS=="win"', {
'defines':[
'WIN32_LEAN_AND_MEAN'
],
'default_configuration': 'Debug',
'configurations': {
'Debug': {
'defines': [ 'DEBUG', '_DEBUG' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 1, # static debug
},
},
},
'Release': {
'defines': [ 'NDEBUG' ],
'msvs_settings': {
'VCCLCompilerTool': {
'RuntimeLibrary': 0, # static release
},
},
}
},
'msvs_settings': {
'VCCLCompilerTool': {
'AdditionalOptions': [ '/EHsc' ],
},
},
}]
]
},
]
}