blob: c2f9c6526d2b138fd57673a664f817d982da79b7 [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',
58 '<(node_root_dir)/deps/openssl/openssl/include'
murgatroid99a89d9e72015-10-13 16:03:16 -070059 ],
60 'conditions': [
61 ['OS != "win"', {
62 'conditions': [
63 ['config=="gcov"', {
64 'cflags': [
65 '-ftest-coverage',
66 '-fprofile-arcs',
67 '-O0'
68 ],
69 'ldflags': [
70 '-ftest-coverage',
71 '-fprofile-arcs'
72 ]
73 }
74 ]
75 ]
76 }],
murgatroid99afe46982015-10-23 10:17:26 -070077 ["target_arch=='ia32'", {
78 "include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ]
79 }],
80 ["target_arch=='x64'", {
81 "include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ]
82 }],
83 ["target_arch=='arm'", {
84 "include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ]
85 }]
murgatroid99fd994f12015-10-09 14:02:28 -070086 ]
87 },
88 'targets': [
89 {
90 'target_name': 'gpr',
91 'product_prefix': 'lib',
92 'type': 'static_library',
93 'dependencies': [
94 ],
95 'sources': [
Craig Tiller95190092015-10-10 20:06:35 -070096 'src/core/profiling/basic_timers.c',
97 'src/core/profiling/stap_timers.c',
murgatroid99fd994f12015-10-09 14:02:28 -070098 'src/core/support/alloc.c',
99 'src/core/support/cmdline.c',
100 'src/core/support/cpu_iphone.c',
101 'src/core/support/cpu_linux.c',
102 'src/core/support/cpu_posix.c',
103 'src/core/support/cpu_windows.c',
104 'src/core/support/env_linux.c',
105 'src/core/support/env_posix.c',
106 'src/core/support/env_win32.c',
107 'src/core/support/file.c',
108 'src/core/support/file_posix.c',
109 'src/core/support/file_win32.c',
110 'src/core/support/histogram.c',
111 'src/core/support/host_port.c',
112 'src/core/support/log.c',
113 'src/core/support/log_android.c',
114 'src/core/support/log_linux.c',
115 'src/core/support/log_posix.c',
116 'src/core/support/log_win32.c',
117 'src/core/support/murmur_hash.c',
118 'src/core/support/slice.c',
119 'src/core/support/slice_buffer.c',
120 'src/core/support/stack_lockfree.c',
121 'src/core/support/string.c',
122 'src/core/support/string_posix.c',
123 'src/core/support/string_win32.c',
124 'src/core/support/subprocess_posix.c',
125 'src/core/support/sync.c',
126 'src/core/support/sync_posix.c',
127 'src/core/support/sync_win32.c',
128 'src/core/support/thd.c',
129 'src/core/support/thd_posix.c',
130 'src/core/support/thd_win32.c',
131 'src/core/support/time.c',
132 'src/core/support/time_posix.c',
Craig Tiller95190092015-10-10 20:06:35 -0700133 'src/core/support/time_precise.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700134 'src/core/support/time_win32.c',
135 'src/core/support/tls_pthread.c',
136 ],
murgatroid996ffdb942015-10-22 16:10:05 -0700137 "conditions": [
138 ['OS == "mac"', {
139 'xcode_settings': {
murgatroid9922c448b2015-10-23 10:25:30 -0700140 'MACOSX_DEPLOYMENT_TARGET': '10.9'
murgatroid996ffdb942015-10-22 16:10:05 -0700141 }
142 }]
143 ],
murgatroid99fd994f12015-10-09 14:02:28 -0700144 },
145 {
146 'target_name': 'grpc',
147 'product_prefix': 'lib',
148 'type': 'static_library',
149 'dependencies': [
150 'gpr',
151 ],
152 'sources': [
153 'src/core/httpcli/httpcli_security_connector.c',
154 'src/core/security/base64.c',
155 'src/core/security/client_auth_filter.c',
156 'src/core/security/credentials.c',
157 'src/core/security/credentials_metadata.c',
158 'src/core/security/credentials_posix.c',
159 'src/core/security/credentials_win32.c',
160 'src/core/security/google_default_credentials.c',
161 'src/core/security/handshake.c',
162 'src/core/security/json_token.c',
163 'src/core/security/jwt_verifier.c',
164 'src/core/security/secure_endpoint.c',
165 'src/core/security/security_connector.c',
166 'src/core/security/security_context.c',
167 'src/core/security/server_auth_filter.c',
168 'src/core/security/server_secure_chttp2.c',
169 'src/core/surface/init_secure.c',
170 'src/core/surface/secure_channel_create.c',
171 'src/core/tsi/fake_transport_security.c',
172 'src/core/tsi/ssl_transport_security.c',
173 'src/core/tsi/transport_security.c',
174 'src/core/census/grpc_context.c',
175 'src/core/census/grpc_filter.c',
176 'src/core/channel/channel_args.c',
177 'src/core/channel/channel_stack.c',
178 'src/core/channel/client_channel.c',
David Garcia Quintasb5ab8a22015-10-19 15:41:42 -0700179 'src/core/channel/client_uchannel.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700180 'src/core/channel/compress_filter.c',
181 'src/core/channel/connected_channel.c',
182 'src/core/channel/http_client_filter.c',
183 'src/core/channel/http_server_filter.c',
184 'src/core/channel/noop_filter.c',
185 'src/core/client_config/client_config.c',
186 'src/core/client_config/connector.c',
187 'src/core/client_config/lb_policies/pick_first.c',
188 'src/core/client_config/lb_policies/round_robin.c',
189 'src/core/client_config/lb_policy.c',
190 'src/core/client_config/lb_policy_factory.c',
191 'src/core/client_config/lb_policy_registry.c',
192 'src/core/client_config/resolver.c',
193 'src/core/client_config/resolver_factory.c',
194 'src/core/client_config/resolver_registry.c',
195 'src/core/client_config/resolvers/dns_resolver.c',
196 'src/core/client_config/resolvers/sockaddr_resolver.c',
197 'src/core/client_config/subchannel.c',
198 'src/core/client_config/subchannel_factory.c',
199 'src/core/client_config/subchannel_factory_decorators/add_channel_arg.c',
200 'src/core/client_config/subchannel_factory_decorators/merge_channel_args.c',
201 'src/core/client_config/uri_parser.c',
202 'src/core/compression/algorithm.c',
203 'src/core/compression/message_compress.c',
204 'src/core/debug/trace.c',
205 'src/core/httpcli/format_request.c',
206 'src/core/httpcli/httpcli.c',
207 'src/core/httpcli/parser.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700208 'src/core/iomgr/closure.c',
209 'src/core/iomgr/endpoint.c',
210 'src/core/iomgr/endpoint_pair_posix.c',
211 'src/core/iomgr/endpoint_pair_windows.c',
212 'src/core/iomgr/exec_ctx.c',
David Garcia Quintas63e72a72015-10-12 22:07:32 -0700213 'src/core/iomgr/executor.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700214 'src/core/iomgr/fd_posix.c',
215 'src/core/iomgr/iocp_windows.c',
216 'src/core/iomgr/iomgr.c',
217 'src/core/iomgr/iomgr_posix.c',
218 'src/core/iomgr/iomgr_windows.c',
219 'src/core/iomgr/pollset_multipoller_with_epoll.c',
220 'src/core/iomgr/pollset_multipoller_with_poll_posix.c',
221 'src/core/iomgr/pollset_posix.c',
222 'src/core/iomgr/pollset_set_posix.c',
223 'src/core/iomgr/pollset_set_windows.c',
224 'src/core/iomgr/pollset_windows.c',
225 'src/core/iomgr/resolve_address_posix.c',
226 'src/core/iomgr/resolve_address_windows.c',
227 'src/core/iomgr/sockaddr_utils.c',
228 'src/core/iomgr/socket_utils_common_posix.c',
229 'src/core/iomgr/socket_utils_linux.c',
230 'src/core/iomgr/socket_utils_posix.c',
231 'src/core/iomgr/socket_windows.c',
232 'src/core/iomgr/tcp_client_posix.c',
233 'src/core/iomgr/tcp_client_windows.c',
234 'src/core/iomgr/tcp_posix.c',
235 'src/core/iomgr/tcp_server_posix.c',
236 'src/core/iomgr/tcp_server_windows.c',
237 'src/core/iomgr/tcp_windows.c',
238 'src/core/iomgr/time_averaged_stats.c',
David Garcia Quintasb65e4212015-10-14 12:00:21 -0700239 'src/core/iomgr/timer.c',
240 'src/core/iomgr/timer_heap.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700241 'src/core/iomgr/udp_server.c',
242 'src/core/iomgr/wakeup_fd_eventfd.c',
243 'src/core/iomgr/wakeup_fd_nospecial.c',
244 'src/core/iomgr/wakeup_fd_pipe.c',
245 'src/core/iomgr/wakeup_fd_posix.c',
246 'src/core/iomgr/workqueue_posix.c',
247 'src/core/iomgr/workqueue_windows.c',
248 'src/core/json/json.c',
249 'src/core/json/json_reader.c',
250 'src/core/json/json_string.c',
251 'src/core/json/json_writer.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700252 'src/core/surface/api_trace.c',
253 'src/core/surface/byte_buffer.c',
254 'src/core/surface/byte_buffer_queue.c',
255 'src/core/surface/byte_buffer_reader.c',
256 'src/core/surface/call.c',
257 'src/core/surface/call_details.c',
258 'src/core/surface/call_log_batch.c',
259 'src/core/surface/channel.c',
260 'src/core/surface/channel_connectivity.c',
261 'src/core/surface/channel_create.c',
262 'src/core/surface/completion_queue.c',
263 'src/core/surface/event_string.c',
264 'src/core/surface/init.c',
265 'src/core/surface/lame_client.c',
266 'src/core/surface/metadata_array.c',
267 'src/core/surface/server.c',
268 'src/core/surface/server_chttp2.c',
269 'src/core/surface/server_create.c',
270 'src/core/surface/version.c',
271 'src/core/transport/chttp2/alpn.c',
272 'src/core/transport/chttp2/bin_encoder.c',
273 'src/core/transport/chttp2/frame_data.c',
274 'src/core/transport/chttp2/frame_goaway.c',
275 'src/core/transport/chttp2/frame_ping.c',
276 'src/core/transport/chttp2/frame_rst_stream.c',
277 'src/core/transport/chttp2/frame_settings.c',
278 'src/core/transport/chttp2/frame_window_update.c',
279 'src/core/transport/chttp2/hpack_parser.c',
280 'src/core/transport/chttp2/hpack_table.c',
281 'src/core/transport/chttp2/huffsyms.c',
282 'src/core/transport/chttp2/incoming_metadata.c',
283 'src/core/transport/chttp2/parsing.c',
284 'src/core/transport/chttp2/status_conversion.c',
285 'src/core/transport/chttp2/stream_encoder.c',
286 'src/core/transport/chttp2/stream_lists.c',
287 'src/core/transport/chttp2/stream_map.c',
288 'src/core/transport/chttp2/timeout_encoding.c',
289 'src/core/transport/chttp2/varint.c',
290 'src/core/transport/chttp2/writing.c',
291 'src/core/transport/chttp2_transport.c',
292 'src/core/transport/connectivity_state.c',
293 'src/core/transport/metadata.c',
294 'src/core/transport/stream_op.c',
295 'src/core/transport/transport.c',
296 'src/core/transport/transport_op_string.c',
297 'src/core/census/context.c',
298 'src/core/census/initialize.c',
299 'src/core/census/operation.c',
300 'src/core/census/tracing.c',
301 ],
murgatroid996ffdb942015-10-22 16:10:05 -0700302 "conditions": [
303 ['OS == "mac"', {
304 'xcode_settings': {
murgatroid9922c448b2015-10-23 10:25:30 -0700305 'MACOSX_DEPLOYMENT_TARGET': '10.9'
murgatroid996ffdb942015-10-22 16:10:05 -0700306 }
307 }]
308 ],
murgatroid99fd994f12015-10-09 14:02:28 -0700309 },
murgatroid992af89e42015-10-01 11:54:00 -0700310 {
311 'include_dirs': [
312 "<!(node -e \"require('nan')\")"
313 ],
314 'cflags': [
315 '-std=c++0x',
316 '-Wall',
317 '-pthread',
318 '-g',
319 '-zdefs',
320 '-Werror',
321 '-Wno-error=deprecated-declarations'
322 ],
323 'ldflags': [
324 '-g'
325 ],
326 "conditions": [
murgatroid992af89e42015-10-01 11:54:00 -0700327 ['OS == "mac"', {
328 'xcode_settings': {
329 'MACOSX_DEPLOYMENT_TARGET': '10.9',
330 'OTHER_CFLAGS': [
331 '-std=c++11',
332 '-stdlib=libc++'
333 ]
334 }
335 }]
336 ],
337 "target_name": "grpc_node",
338 "sources": [
339 "src/node/ext/byte_buffer.cc",
340 "src/node/ext/call.cc",
murgatroid9947f519e2015-10-07 12:34:24 -0700341 "src/node/ext/call_credentials.cc",
murgatroid992af89e42015-10-01 11:54:00 -0700342 "src/node/ext/channel.cc",
murgatroid9947f519e2015-10-07 12:34:24 -0700343 "src/node/ext/channel_credentials.cc",
murgatroid992af89e42015-10-01 11:54:00 -0700344 "src/node/ext/completion_queue_async_worker.cc",
murgatroid992af89e42015-10-01 11:54:00 -0700345 "src/node/ext/node_grpc.cc",
346 "src/node/ext/server.cc",
347 "src/node/ext/server_credentials.cc",
348 "src/node/ext/timeval.cc"
349 ],
350 "dependencies": [
murgatroid99fd994f12015-10-09 14:02:28 -0700351 "grpc"
murgatroid992af89e42015-10-01 11:54:00 -0700352 ]
353 }
354 ]
355}