blob: 9b1dc7a90c36a1a66151c2bb317d63aa1cb9cdc5 [file] [log] [blame]
murgatroid99fd994f12015-10-09 14:02:28 -07001# GRPC Node gyp file
2# This currently builds the Node extension and dependencies
3# This file has been automatically generated from a template file.
4# Please look at the templates directory instead.
5# This file can be regenerated from the template by running
6# tools/buildgen/generate_projects.sh
7
murgatroid99f33b1322015-10-05 09:45:04 -07008# Copyright 2015, Google Inc.
9# All rights reserved.
10#
11# Redistribution and use in source and binary forms, with or without
12# modification, are permitted provided that the following conditions are
13# met:
14#
15# * Redistributions of source code must retain the above copyright
16# notice, this list of conditions and the following disclaimer.
17# * Redistributions in binary form must reproduce the above
18# copyright notice, this list of conditions and the following disclaimer
19# in the documentation and/or other materials provided with the
20# distribution.
21# * Neither the name of Google Inc. nor the names of its
22# contributors may be used to endorse or promote products derived from
23# this software without specific prior written permission.
24#
25# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
murgatroid99fd994f12015-10-09 14:02:28 -070036
37# Some of this file is built with the help of
38# https://n8.io/converting-a-c-library-to-gyp/
murgatroid992af89e42015-10-01 11:54:00 -070039{
murgatroid99fd994f12015-10-09 14:02:28 -070040 'variables': {
murgatroid992af89e42015-10-01 11:54:00 -070041 'config': '<!(echo $CONFIG)'
42 },
murgatroid99fd994f12015-10-09 14:02:28 -070043 # TODO: Finish windows support
44 'target_defaults': {
murgatroid99e7540792015-10-09 15:43:14 -070045 # Empirically, Node only exports ALPN symbols if its major version is >0.
murgatroid99fd994f12015-10-09 14:02:28 -070046 # io.js always reports versions >0 and always exports ALPN symbols.
murgatroid9915def982015-10-09 14:11:02 -070047 # Therefore, Node's major version will be truthy if and only if it
48 # supports ALPN. The output of "node -v" is v[major].[minor].[patch],
murgatroid99c07c7342015-10-19 17:41:03 -070049 # like "v4.1.1" in a recent version. We use cut to split by period and
50 # take the first field (resulting in "v[major]"), then use cut again
51 # to take all but the first character, removing the "v".
murgatroid99fd994f12015-10-09 14:02:28 -070052 'defines': [
murgatroid99c07c7342015-10-19 17:41:03 -070053 'TSI_OPENSSL_ALPN_SUPPORT=<!(node --version | cut -d. -f1 | cut -c2-)'
murgatroid99fd994f12015-10-09 14:02:28 -070054 ],
55 'include_dirs': [
56 '.',
57 'include'
murgatroid99a89d9e72015-10-13 16:03:16 -070058 ],
59 'conditions': [
60 ['OS != "win"', {
61 'conditions': [
62 ['config=="gcov"', {
63 'cflags': [
64 '-ftest-coverage',
65 '-fprofile-arcs',
66 '-O0'
67 ],
68 'ldflags': [
69 '-ftest-coverage',
70 '-fprofile-arcs'
71 ]
72 }
73 ]
74 ]
75 }],
murgatroid99fd994f12015-10-09 14:02:28 -070076 ]
77 },
78 'targets': [
79 {
80 'target_name': 'gpr',
81 'product_prefix': 'lib',
82 'type': 'static_library',
83 'dependencies': [
84 ],
85 'sources': [
Craig Tiller95190092015-10-10 20:06:35 -070086 'src/core/profiling/basic_timers.c',
87 'src/core/profiling/stap_timers.c',
murgatroid99fd994f12015-10-09 14:02:28 -070088 'src/core/support/alloc.c',
89 'src/core/support/cmdline.c',
90 'src/core/support/cpu_iphone.c',
91 'src/core/support/cpu_linux.c',
92 'src/core/support/cpu_posix.c',
93 'src/core/support/cpu_windows.c',
94 'src/core/support/env_linux.c',
95 'src/core/support/env_posix.c',
96 'src/core/support/env_win32.c',
97 'src/core/support/file.c',
98 'src/core/support/file_posix.c',
99 'src/core/support/file_win32.c',
100 'src/core/support/histogram.c',
101 'src/core/support/host_port.c',
102 'src/core/support/log.c',
103 'src/core/support/log_android.c',
104 'src/core/support/log_linux.c',
105 'src/core/support/log_posix.c',
106 'src/core/support/log_win32.c',
107 'src/core/support/murmur_hash.c',
108 'src/core/support/slice.c',
109 'src/core/support/slice_buffer.c',
110 'src/core/support/stack_lockfree.c',
111 'src/core/support/string.c',
112 'src/core/support/string_posix.c',
113 'src/core/support/string_win32.c',
114 'src/core/support/subprocess_posix.c',
115 'src/core/support/sync.c',
116 'src/core/support/sync_posix.c',
117 'src/core/support/sync_win32.c',
118 'src/core/support/thd.c',
119 'src/core/support/thd_posix.c',
120 'src/core/support/thd_win32.c',
121 'src/core/support/time.c',
122 'src/core/support/time_posix.c',
Craig Tiller95190092015-10-10 20:06:35 -0700123 'src/core/support/time_precise.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700124 'src/core/support/time_win32.c',
125 'src/core/support/tls_pthread.c',
126 ],
murgatroid996ffdb942015-10-22 16:10:05 -0700127 "conditions": [
128 ['OS == "mac"', {
129 'xcode_settings': {
130 'MACOSX_DEPLOYMENT_TARGET': '10.9',
131 'OTHER_CFLAGS': [
132 '-stdlib=libc++'
133 ]
134 }
135 }]
136 ],
murgatroid99fd994f12015-10-09 14:02:28 -0700137 },
138 {
139 'target_name': 'grpc',
140 'product_prefix': 'lib',
141 'type': 'static_library',
142 'dependencies': [
143 'gpr',
144 ],
145 'sources': [
146 'src/core/httpcli/httpcli_security_connector.c',
147 'src/core/security/base64.c',
148 'src/core/security/client_auth_filter.c',
149 'src/core/security/credentials.c',
150 'src/core/security/credentials_metadata.c',
151 'src/core/security/credentials_posix.c',
152 'src/core/security/credentials_win32.c',
153 'src/core/security/google_default_credentials.c',
154 'src/core/security/handshake.c',
155 'src/core/security/json_token.c',
156 'src/core/security/jwt_verifier.c',
157 'src/core/security/secure_endpoint.c',
158 'src/core/security/security_connector.c',
159 'src/core/security/security_context.c',
160 'src/core/security/server_auth_filter.c',
161 'src/core/security/server_secure_chttp2.c',
162 'src/core/surface/init_secure.c',
163 'src/core/surface/secure_channel_create.c',
164 'src/core/tsi/fake_transport_security.c',
165 'src/core/tsi/ssl_transport_security.c',
166 'src/core/tsi/transport_security.c',
167 'src/core/census/grpc_context.c',
168 'src/core/census/grpc_filter.c',
169 'src/core/channel/channel_args.c',
170 'src/core/channel/channel_stack.c',
171 'src/core/channel/client_channel.c',
David Garcia Quintasb5ab8a22015-10-19 15:41:42 -0700172 'src/core/channel/client_uchannel.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700173 'src/core/channel/compress_filter.c',
174 'src/core/channel/connected_channel.c',
175 'src/core/channel/http_client_filter.c',
176 'src/core/channel/http_server_filter.c',
177 'src/core/channel/noop_filter.c',
178 'src/core/client_config/client_config.c',
179 'src/core/client_config/connector.c',
180 'src/core/client_config/lb_policies/pick_first.c',
181 'src/core/client_config/lb_policies/round_robin.c',
182 'src/core/client_config/lb_policy.c',
183 'src/core/client_config/lb_policy_factory.c',
184 'src/core/client_config/lb_policy_registry.c',
185 'src/core/client_config/resolver.c',
186 'src/core/client_config/resolver_factory.c',
187 'src/core/client_config/resolver_registry.c',
188 'src/core/client_config/resolvers/dns_resolver.c',
189 'src/core/client_config/resolvers/sockaddr_resolver.c',
190 'src/core/client_config/subchannel.c',
191 'src/core/client_config/subchannel_factory.c',
192 'src/core/client_config/subchannel_factory_decorators/add_channel_arg.c',
193 'src/core/client_config/subchannel_factory_decorators/merge_channel_args.c',
194 'src/core/client_config/uri_parser.c',
195 'src/core/compression/algorithm.c',
196 'src/core/compression/message_compress.c',
197 'src/core/debug/trace.c',
198 'src/core/httpcli/format_request.c',
199 'src/core/httpcli/httpcli.c',
200 'src/core/httpcli/parser.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700201 'src/core/iomgr/closure.c',
202 'src/core/iomgr/endpoint.c',
203 'src/core/iomgr/endpoint_pair_posix.c',
204 'src/core/iomgr/endpoint_pair_windows.c',
205 'src/core/iomgr/exec_ctx.c',
David Garcia Quintas63e72a72015-10-12 22:07:32 -0700206 'src/core/iomgr/executor.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700207 'src/core/iomgr/fd_posix.c',
208 'src/core/iomgr/iocp_windows.c',
209 'src/core/iomgr/iomgr.c',
210 'src/core/iomgr/iomgr_posix.c',
211 'src/core/iomgr/iomgr_windows.c',
212 'src/core/iomgr/pollset_multipoller_with_epoll.c',
213 'src/core/iomgr/pollset_multipoller_with_poll_posix.c',
214 'src/core/iomgr/pollset_posix.c',
215 'src/core/iomgr/pollset_set_posix.c',
216 'src/core/iomgr/pollset_set_windows.c',
217 'src/core/iomgr/pollset_windows.c',
218 'src/core/iomgr/resolve_address_posix.c',
219 'src/core/iomgr/resolve_address_windows.c',
220 'src/core/iomgr/sockaddr_utils.c',
221 'src/core/iomgr/socket_utils_common_posix.c',
222 'src/core/iomgr/socket_utils_linux.c',
223 'src/core/iomgr/socket_utils_posix.c',
224 'src/core/iomgr/socket_windows.c',
225 'src/core/iomgr/tcp_client_posix.c',
226 'src/core/iomgr/tcp_client_windows.c',
227 'src/core/iomgr/tcp_posix.c',
228 'src/core/iomgr/tcp_server_posix.c',
229 'src/core/iomgr/tcp_server_windows.c',
230 'src/core/iomgr/tcp_windows.c',
231 'src/core/iomgr/time_averaged_stats.c',
David Garcia Quintasb65e4212015-10-14 12:00:21 -0700232 'src/core/iomgr/timer.c',
233 'src/core/iomgr/timer_heap.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700234 'src/core/iomgr/udp_server.c',
235 'src/core/iomgr/wakeup_fd_eventfd.c',
236 'src/core/iomgr/wakeup_fd_nospecial.c',
237 'src/core/iomgr/wakeup_fd_pipe.c',
238 'src/core/iomgr/wakeup_fd_posix.c',
239 'src/core/iomgr/workqueue_posix.c',
240 'src/core/iomgr/workqueue_windows.c',
241 'src/core/json/json.c',
242 'src/core/json/json_reader.c',
243 'src/core/json/json_string.c',
244 'src/core/json/json_writer.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700245 'src/core/surface/api_trace.c',
246 'src/core/surface/byte_buffer.c',
247 'src/core/surface/byte_buffer_queue.c',
248 'src/core/surface/byte_buffer_reader.c',
249 'src/core/surface/call.c',
250 'src/core/surface/call_details.c',
251 'src/core/surface/call_log_batch.c',
252 'src/core/surface/channel.c',
253 'src/core/surface/channel_connectivity.c',
254 'src/core/surface/channel_create.c',
255 'src/core/surface/completion_queue.c',
256 'src/core/surface/event_string.c',
257 'src/core/surface/init.c',
258 'src/core/surface/lame_client.c',
259 'src/core/surface/metadata_array.c',
260 'src/core/surface/server.c',
261 'src/core/surface/server_chttp2.c',
262 'src/core/surface/server_create.c',
263 'src/core/surface/version.c',
264 'src/core/transport/chttp2/alpn.c',
265 'src/core/transport/chttp2/bin_encoder.c',
266 'src/core/transport/chttp2/frame_data.c',
267 'src/core/transport/chttp2/frame_goaway.c',
268 'src/core/transport/chttp2/frame_ping.c',
269 'src/core/transport/chttp2/frame_rst_stream.c',
270 'src/core/transport/chttp2/frame_settings.c',
271 'src/core/transport/chttp2/frame_window_update.c',
272 'src/core/transport/chttp2/hpack_parser.c',
273 'src/core/transport/chttp2/hpack_table.c',
274 'src/core/transport/chttp2/huffsyms.c',
275 'src/core/transport/chttp2/incoming_metadata.c',
276 'src/core/transport/chttp2/parsing.c',
277 'src/core/transport/chttp2/status_conversion.c',
278 'src/core/transport/chttp2/stream_encoder.c',
279 'src/core/transport/chttp2/stream_lists.c',
280 'src/core/transport/chttp2/stream_map.c',
281 'src/core/transport/chttp2/timeout_encoding.c',
282 'src/core/transport/chttp2/varint.c',
283 'src/core/transport/chttp2/writing.c',
284 'src/core/transport/chttp2_transport.c',
285 'src/core/transport/connectivity_state.c',
286 'src/core/transport/metadata.c',
287 'src/core/transport/stream_op.c',
288 'src/core/transport/transport.c',
289 'src/core/transport/transport_op_string.c',
290 'src/core/census/context.c',
291 'src/core/census/initialize.c',
292 'src/core/census/operation.c',
293 'src/core/census/tracing.c',
294 ],
murgatroid996ffdb942015-10-22 16:10:05 -0700295 "conditions": [
296 ['OS == "mac"', {
297 'xcode_settings': {
298 'MACOSX_DEPLOYMENT_TARGET': '10.9',
299 'OTHER_CFLAGS': [
300 '-stdlib=libc++'
301 ]
302 }
303 }]
304 ],
murgatroid99fd994f12015-10-09 14:02:28 -0700305 },
murgatroid992af89e42015-10-01 11:54:00 -0700306 {
307 'include_dirs': [
308 "<!(node -e \"require('nan')\")"
309 ],
310 'cflags': [
311 '-std=c++0x',
312 '-Wall',
313 '-pthread',
314 '-g',
315 '-zdefs',
316 '-Werror',
317 '-Wno-error=deprecated-declarations'
318 ],
319 'ldflags': [
320 '-g'
321 ],
322 "conditions": [
murgatroid992af89e42015-10-01 11:54:00 -0700323 ['OS == "mac"', {
324 'xcode_settings': {
325 'MACOSX_DEPLOYMENT_TARGET': '10.9',
326 'OTHER_CFLAGS': [
327 '-std=c++11',
328 '-stdlib=libc++'
329 ]
330 }
331 }]
332 ],
333 "target_name": "grpc_node",
334 "sources": [
335 "src/node/ext/byte_buffer.cc",
336 "src/node/ext/call.cc",
murgatroid9947f519e2015-10-07 12:34:24 -0700337 "src/node/ext/call_credentials.cc",
murgatroid992af89e42015-10-01 11:54:00 -0700338 "src/node/ext/channel.cc",
murgatroid9947f519e2015-10-07 12:34:24 -0700339 "src/node/ext/channel_credentials.cc",
murgatroid992af89e42015-10-01 11:54:00 -0700340 "src/node/ext/completion_queue_async_worker.cc",
murgatroid992af89e42015-10-01 11:54:00 -0700341 "src/node/ext/node_grpc.cc",
342 "src/node/ext/server.cc",
343 "src/node/ext/server_credentials.cc",
344 "src/node/ext/timeval.cc"
345 ],
346 "dependencies": [
murgatroid99fd994f12015-10-09 14:02:28 -0700347 "grpc"
murgatroid992af89e42015-10-01 11:54:00 -0700348 ]
349 }
350 ]
351}