forked from node-webrtc/node-webrtc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
binding.gyp
157 lines (155 loc) · 4.41 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
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
{
'variables': {
'libwebrtc%': 'third_party/libwebrtc',
#'configuration%': 'Release',
},
'conditions': [
['OS=="linux"', {
'variables': {
}
}],
['OS=="mac"', {
'variables': {
}
}],
],
'targets': [
{
'target_name': 'action_before_build',
'variables': {
},
'dependencies': [],
'hard_dependency': 1,
'type': 'none',
'actions': [
{
'action_name': 'run_build_script',
'inputs': [],
'outputs': ['/dev/null'],
'action': [
'node', 'bin/build.js', '--target-arch', '<(target_arch)', '--configuration', '$(BUILDTYPE)', '--module_path', '<(module_path)'
],
'message': 'Run build script'
}
]
},
{
'target_name': 'wrtc',
'dependencies': [
'action_before_build'
],
'variables': {
'libwebrtc_out%': '<(libwebrtc)/out/$(BUILDTYPE)/obj',
},
'cflags': [
'-pthread',
'-fno-exceptions',
'-fno-strict-aliasing',
'-Wall',
'-Wno-unused-parameter',
'-Wno-missing-field-initializers',
'-Wextra',
'-Wno-unused-local-typedefs',
'-Wno-uninitialized',
'-Wno-unused-variable',
'-Wno-unused-but-set-variable',
'-pipe',
'-fno-ident',
'-fdata-sections',
'-ffunction-sections',
'-fPIC',
'-fpermissive',
],
'xcode_settings': {
'OTHER_CFLAGS': [
'-std=gnu++0x',
'-Wno-c++0x-extensions',
'-Wno-c++11-extensions',
]
},
'defines': [
# 'TRACING',
'LARGEFILE_SOURCE',
'_FILE_OFFSET_BITS=64',
'WEBRTC_TARGET_PC',
'WEBRTC_LINUX',
'WEBRTC_THREAD_RR',
'EXPAT_RELATIVE_PATH',
'GTEST_RELATIVE_PATH',
'JSONCPP_RELATIVE_PATH',
'WEBRTC_RELATIVE_PATH',
'POSIX',
'__STDC_FORMAT_MACROS',
'DYNAMIC_ANNOTATIONS_ENABLED=0',
'WEBRTC_POSIX=1'
],
'include_dirs': [
"<!(node -p -e \"require('path').relative('.', require('path').dirname(require.resolve('nan')))\")",
'<(libwebrtc)',
'<(libwebrtc)/third_party/webrtc',
'<(libwebrtc)/third_party/webrtc/system_wrappers/interface',
'<(libwebrtc)/third_party',
],
'link_settings': {
'ldflags': [
],
'conditions': [
['OS=="linux"', {
'libraries': [
'../<(libwebrtc_out)/talk/libjingle_peerconnection.a',
'../<(libwebrtc_out)/talk/libjingle_p2p.a',
'../<(libwebrtc_out)/talk/libjingle_media.a',
'../<(libwebrtc_out)/webrtc/p2p/librtc_p2p.a',
'../<(libwebrtc_out)/webrtc/base/librtc_base.a',
'../<(libwebrtc_out)/webrtc/base/librtc_base_approved.a',
'../<(libwebrtc_out)/chromium/src/net/third_party/nss/libcrssl.a',
'../<(libwebrtc_out)/chromium/src/third_party/usrsctp/libusrsctplib.a',
# '-lssl',
'-lnss3',
]
}],
['OS=="mac"', {
'libraries': [
'../<(libwebrtc_out)/../libjingle_peerconnection.a',
'../<(libwebrtc_out)/../libjingle_p2p.a',
'../<(libwebrtc_out)/../libjingle_media.a',
'../<(libwebrtc_out)/../librtc_p2p.a',
'../<(libwebrtc_out)/../librtc_base.a',
'../<(libwebrtc_out)/../librtc_base_approved.a',
'../<(libwebrtc_out)/../libusrsctplib.a',
'../<(libwebrtc_out)/../libboringssl.a',
'-framework AppKit',
'-framework QTKit',
# '-lssl',
]
}],
],
'libraries': [
]
},
'sources': [
'src/binding.cc',
'src/create-offer-observer.cc',
'src/create-answer-observer.cc',
'src/set-local-description-observer.cc',
'src/set-remote-description-observer.cc',
'src/peerconnection.cc',
'src/datachannel.cc',
'src/rtcstatsreport.cc',
'src/rtcstatsresponse.cc',
'src/stats-observer.cc'
]
},
{
"target_name": "action_after_build",
"type": "none",
"dependencies": [ "<(module_name)" ],
"copies": [
{
"files": [ "<(PRODUCT_DIR)/<(module_name).node" ],
"destination": "<(module_path)"
}
]
}
]
}