blob: 1ec7a67f6554ed7f8fdb37020bb7782f3a5a23c9 [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 '.',
murgatroid99afe46982015-10-23 10:17:26 -070057 'include',
murgatroid998dcdcc72015-10-26 10:45:00 -070058 '<(node_root_dir)/deps/openssl/openssl/include',
59 '<(node_root_dir)/deps/zlib'
murgatroid99a89d9e72015-10-13 16:03:16 -070060 ],
61 'conditions': [
62 ['OS != "win"', {
63 'conditions': [
64 ['config=="gcov"', {
65 'cflags': [
66 '-ftest-coverage',
67 '-fprofile-arcs',
68 '-O0'
69 ],
70 'ldflags': [
71 '-ftest-coverage',
72 '-fprofile-arcs'
73 ]
74 }
75 ]
76 ]
77 }],
murgatroid99afe46982015-10-23 10:17:26 -070078 ["target_arch=='ia32'", {
79 "include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ]
80 }],
81 ["target_arch=='x64'", {
82 "include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ]
83 }],
84 ["target_arch=='arm'", {
85 "include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ]
86 }]
murgatroid99fd994f12015-10-09 14:02:28 -070087 ]
88 },
89 'targets': [
90 {
murgatroid993abed312016-01-07 17:16:46 -080091 'cflags': [
92 '-std=c99',
93 '-Wall',
94 '-Werror'
95 ],
murgatroid99fd994f12015-10-09 14:02:28 -070096 'target_name': 'gpr',
97 'product_prefix': 'lib',
98 'type': 'static_library',
99 'dependencies': [
100 ],
101 'sources': [
Craig Tiller95190092015-10-10 20:06:35 -0700102 'src/core/profiling/basic_timers.c',
103 'src/core/profiling/stap_timers.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700104 'src/core/support/alloc.c',
Craig Tillerfba79f22015-11-23 11:06:55 -0800105 'src/core/support/avl.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700106 'src/core/support/cmdline.c',
107 'src/core/support/cpu_iphone.c',
108 'src/core/support/cpu_linux.c',
109 'src/core/support/cpu_posix.c',
110 'src/core/support/cpu_windows.c',
111 'src/core/support/env_linux.c',
112 'src/core/support/env_posix.c',
113 'src/core/support/env_win32.c',
114 'src/core/support/file.c',
115 'src/core/support/file_posix.c',
116 'src/core/support/file_win32.c',
117 'src/core/support/histogram.c',
118 'src/core/support/host_port.c',
119 'src/core/support/log.c',
120 'src/core/support/log_android.c',
121 'src/core/support/log_linux.c',
122 'src/core/support/log_posix.c',
123 'src/core/support/log_win32.c',
124 'src/core/support/murmur_hash.c',
125 'src/core/support/slice.c',
126 'src/core/support/slice_buffer.c',
127 'src/core/support/stack_lockfree.c',
128 'src/core/support/string.c',
129 'src/core/support/string_posix.c',
130 'src/core/support/string_win32.c',
131 'src/core/support/subprocess_posix.c',
132 'src/core/support/sync.c',
133 'src/core/support/sync_posix.c',
134 'src/core/support/sync_win32.c',
135 'src/core/support/thd.c',
136 'src/core/support/thd_posix.c',
137 'src/core/support/thd_win32.c',
138 'src/core/support/time.c',
139 'src/core/support/time_posix.c',
Craig Tiller95190092015-10-10 20:06:35 -0700140 'src/core/support/time_precise.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700141 'src/core/support/time_win32.c',
142 'src/core/support/tls_pthread.c',
143 ],
murgatroid996ffdb942015-10-22 16:10:05 -0700144 "conditions": [
145 ['OS == "mac"', {
146 'xcode_settings': {
murgatroid9922c448b2015-10-23 10:25:30 -0700147 'MACOSX_DEPLOYMENT_TARGET': '10.9'
murgatroid996ffdb942015-10-22 16:10:05 -0700148 }
149 }]
150 ],
murgatroid99fd994f12015-10-09 14:02:28 -0700151 },
152 {
murgatroid993abed312016-01-07 17:16:46 -0800153 'cflags': [
154 '-std=c99',
155 '-Wall',
156 '-Werror'
157 ],
murgatroid99fd994f12015-10-09 14:02:28 -0700158 'target_name': 'grpc',
159 'product_prefix': 'lib',
160 'type': 'static_library',
161 'dependencies': [
162 'gpr',
163 ],
164 'sources': [
165 'src/core/httpcli/httpcli_security_connector.c',
166 'src/core/security/base64.c',
167 'src/core/security/client_auth_filter.c',
168 'src/core/security/credentials.c',
169 'src/core/security/credentials_metadata.c',
170 'src/core/security/credentials_posix.c',
171 'src/core/security/credentials_win32.c',
172 'src/core/security/google_default_credentials.c',
173 'src/core/security/handshake.c',
174 'src/core/security/json_token.c',
175 'src/core/security/jwt_verifier.c',
176 'src/core/security/secure_endpoint.c',
177 'src/core/security/security_connector.c',
178 'src/core/security/security_context.c',
179 'src/core/security/server_auth_filter.c',
180 'src/core/security/server_secure_chttp2.c',
181 'src/core/surface/init_secure.c',
182 'src/core/surface/secure_channel_create.c',
183 'src/core/tsi/fake_transport_security.c',
184 'src/core/tsi/ssl_transport_security.c',
185 'src/core/tsi/transport_security.c',
186 'src/core/census/grpc_context.c',
187 'src/core/census/grpc_filter.c',
188 'src/core/channel/channel_args.c',
189 'src/core/channel/channel_stack.c',
190 'src/core/channel/client_channel.c',
David Garcia Quintasb5ab8a22015-10-19 15:41:42 -0700191 'src/core/channel/client_uchannel.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700192 'src/core/channel/compress_filter.c',
193 'src/core/channel/connected_channel.c',
194 'src/core/channel/http_client_filter.c',
195 'src/core/channel/http_server_filter.c',
Craig Tillerca1593a2015-11-02 14:08:33 -0800196 'src/core/channel/subchannel_call_holder.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700197 'src/core/client_config/client_config.c',
198 'src/core/client_config/connector.c',
yang-ga6124122015-11-05 22:36:20 -0800199 'src/core/client_config/default_initial_connect_string.c',
200 'src/core/client_config/initial_connect_string.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700201 'src/core/client_config/lb_policies/pick_first.c',
202 'src/core/client_config/lb_policies/round_robin.c',
203 'src/core/client_config/lb_policy.c',
204 'src/core/client_config/lb_policy_factory.c',
205 'src/core/client_config/lb_policy_registry.c',
206 'src/core/client_config/resolver.c',
207 'src/core/client_config/resolver_factory.c',
208 'src/core/client_config/resolver_registry.c',
209 'src/core/client_config/resolvers/dns_resolver.c',
210 'src/core/client_config/resolvers/sockaddr_resolver.c',
211 'src/core/client_config/subchannel.c',
212 'src/core/client_config/subchannel_factory.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700213 'src/core/client_config/uri_parser.c',
214 'src/core/compression/algorithm.c',
215 'src/core/compression/message_compress.c',
216 'src/core/debug/trace.c',
217 'src/core/httpcli/format_request.c',
218 'src/core/httpcli/httpcli.c',
219 'src/core/httpcli/parser.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700220 'src/core/iomgr/closure.c',
221 'src/core/iomgr/endpoint.c',
222 'src/core/iomgr/endpoint_pair_posix.c',
223 'src/core/iomgr/endpoint_pair_windows.c',
224 'src/core/iomgr/exec_ctx.c',
David Garcia Quintas63e72a72015-10-12 22:07:32 -0700225 'src/core/iomgr/executor.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700226 'src/core/iomgr/fd_posix.c',
227 'src/core/iomgr/iocp_windows.c',
228 'src/core/iomgr/iomgr.c',
229 'src/core/iomgr/iomgr_posix.c',
230 'src/core/iomgr/iomgr_windows.c',
231 'src/core/iomgr/pollset_multipoller_with_epoll.c',
232 'src/core/iomgr/pollset_multipoller_with_poll_posix.c',
233 'src/core/iomgr/pollset_posix.c',
234 'src/core/iomgr/pollset_set_posix.c',
235 'src/core/iomgr/pollset_set_windows.c',
236 'src/core/iomgr/pollset_windows.c',
237 'src/core/iomgr/resolve_address_posix.c',
238 'src/core/iomgr/resolve_address_windows.c',
239 'src/core/iomgr/sockaddr_utils.c',
240 'src/core/iomgr/socket_utils_common_posix.c',
241 'src/core/iomgr/socket_utils_linux.c',
242 'src/core/iomgr/socket_utils_posix.c',
243 'src/core/iomgr/socket_windows.c',
244 'src/core/iomgr/tcp_client_posix.c',
245 'src/core/iomgr/tcp_client_windows.c',
246 'src/core/iomgr/tcp_posix.c',
247 'src/core/iomgr/tcp_server_posix.c',
248 'src/core/iomgr/tcp_server_windows.c',
249 'src/core/iomgr/tcp_windows.c',
250 'src/core/iomgr/time_averaged_stats.c',
David Garcia Quintasb65e4212015-10-14 12:00:21 -0700251 'src/core/iomgr/timer.c',
252 'src/core/iomgr/timer_heap.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700253 'src/core/iomgr/udp_server.c',
254 'src/core/iomgr/wakeup_fd_eventfd.c',
255 'src/core/iomgr/wakeup_fd_nospecial.c',
256 'src/core/iomgr/wakeup_fd_pipe.c',
257 'src/core/iomgr/wakeup_fd_posix.c',
258 'src/core/iomgr/workqueue_posix.c',
259 'src/core/iomgr/workqueue_windows.c',
260 'src/core/json/json.c',
261 'src/core/json/json_reader.c',
262 'src/core/json/json_string.c',
263 'src/core/json/json_writer.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700264 'src/core/surface/api_trace.c',
265 'src/core/surface/byte_buffer.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700266 'src/core/surface/byte_buffer_reader.c',
267 'src/core/surface/call.c',
268 'src/core/surface/call_details.c',
269 'src/core/surface/call_log_batch.c',
270 'src/core/surface/channel.c',
271 'src/core/surface/channel_connectivity.c',
272 'src/core/surface/channel_create.c',
Craig Tiller26dab312015-12-07 14:43:47 -0800273 'src/core/surface/channel_ping.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700274 'src/core/surface/completion_queue.c',
275 'src/core/surface/event_string.c',
276 'src/core/surface/init.c',
277 'src/core/surface/lame_client.c',
278 'src/core/surface/metadata_array.c',
279 'src/core/surface/server.c',
280 'src/core/surface/server_chttp2.c',
281 'src/core/surface/server_create.c',
murgatroid99c3910ca2016-01-06 13:14:23 -0800282 'src/core/surface/validate_metadata.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700283 'src/core/surface/version.c',
Craig Tillerca1593a2015-11-02 14:08:33 -0800284 'src/core/transport/byte_stream.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700285 'src/core/transport/chttp2/alpn.c',
286 'src/core/transport/chttp2/bin_encoder.c',
287 'src/core/transport/chttp2/frame_data.c',
288 'src/core/transport/chttp2/frame_goaway.c',
289 'src/core/transport/chttp2/frame_ping.c',
290 'src/core/transport/chttp2/frame_rst_stream.c',
291 'src/core/transport/chttp2/frame_settings.c',
292 'src/core/transport/chttp2/frame_window_update.c',
Craig Tillerca1593a2015-11-02 14:08:33 -0800293 'src/core/transport/chttp2/hpack_encoder.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700294 'src/core/transport/chttp2/hpack_parser.c',
295 'src/core/transport/chttp2/hpack_table.c',
296 'src/core/transport/chttp2/huffsyms.c',
297 'src/core/transport/chttp2/incoming_metadata.c',
298 'src/core/transport/chttp2/parsing.c',
299 'src/core/transport/chttp2/status_conversion.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700300 'src/core/transport/chttp2/stream_lists.c',
301 'src/core/transport/chttp2/stream_map.c',
302 'src/core/transport/chttp2/timeout_encoding.c',
303 'src/core/transport/chttp2/varint.c',
304 'src/core/transport/chttp2/writing.c',
305 'src/core/transport/chttp2_transport.c',
306 'src/core/transport/connectivity_state.c',
307 'src/core/transport/metadata.c',
Craig Tillerca1593a2015-11-02 14:08:33 -0800308 'src/core/transport/metadata_batch.c',
Craig Tiller2e7687c2015-11-18 14:56:46 -0800309 'src/core/transport/static_metadata.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700310 'src/core/transport/transport.c',
311 'src/core/transport/transport_op_string.c',
312 'src/core/census/context.c',
313 'src/core/census/initialize.c',
314 'src/core/census/operation.c',
315 'src/core/census/tracing.c',
316 ],
murgatroid996ffdb942015-10-22 16:10:05 -0700317 "conditions": [
318 ['OS == "mac"', {
319 'xcode_settings': {
murgatroid9922c448b2015-10-23 10:25:30 -0700320 'MACOSX_DEPLOYMENT_TARGET': '10.9'
murgatroid996ffdb942015-10-22 16:10:05 -0700321 }
322 }]
323 ],
murgatroid99fd994f12015-10-09 14:02:28 -0700324 },
murgatroid992af89e42015-10-01 11:54:00 -0700325 {
326 'include_dirs': [
327 "<!(node -e \"require('nan')\")"
328 ],
329 'cflags': [
murgatroid993abed312016-01-07 17:16:46 -0800330 '-std=c++11',
murgatroid992af89e42015-10-01 11:54:00 -0700331 '-Wall',
332 '-pthread',
333 '-g',
334 '-zdefs',
335 '-Werror',
336 '-Wno-error=deprecated-declarations'
337 ],
338 'ldflags': [
339 '-g'
340 ],
341 "conditions": [
murgatroid992af89e42015-10-01 11:54:00 -0700342 ['OS == "mac"', {
343 'xcode_settings': {
344 'MACOSX_DEPLOYMENT_TARGET': '10.9',
345 'OTHER_CFLAGS': [
murgatroid992af89e42015-10-01 11:54:00 -0700346 '-stdlib=libc++'
347 ]
348 }
349 }]
350 ],
351 "target_name": "grpc_node",
352 "sources": [
353 "src/node/ext/byte_buffer.cc",
354 "src/node/ext/call.cc",
murgatroid9947f519e2015-10-07 12:34:24 -0700355 "src/node/ext/call_credentials.cc",
murgatroid992af89e42015-10-01 11:54:00 -0700356 "src/node/ext/channel.cc",
murgatroid9947f519e2015-10-07 12:34:24 -0700357 "src/node/ext/channel_credentials.cc",
murgatroid992af89e42015-10-01 11:54:00 -0700358 "src/node/ext/completion_queue_async_worker.cc",
murgatroid992af89e42015-10-01 11:54:00 -0700359 "src/node/ext/node_grpc.cc",
360 "src/node/ext/server.cc",
361 "src/node/ext/server_credentials.cc",
murgatroid99879bc4f2015-11-05 10:35:04 -0800362 "src/node/ext/timeval.cc",
murgatroid992af89e42015-10-01 11:54:00 -0700363 ],
364 "dependencies": [
murgatroid99879bc4f2015-11-05 10:35:04 -0800365 "grpc",
366 "gpr",
murgatroid992af89e42015-10-01 11:54:00 -0700367 ]
murgatroid99879bc4f2015-11-05 10:35:04 -0800368 },
murgatroid99e190f352016-01-20 13:52:08 -0800369 {
370 "target_name": "action_after_build",
371 "type": "none",
372 "dependencies": [ "<(module_name)" ],
373 "copies": [
374 {
375 "files": [ "<(PRODUCT_DIR)/<(module_name).node"],
376 "destination": "<(module_path)"
377 }
378 ]
379 }
murgatroid992af89e42015-10-01 11:54:00 -0700380 ]
381}