blob: f886dc1e276cce40b6da74cd71c75a3a87c2552b [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],
49 # like "v4.1.1" in a recent version. We use grep to extract just the
50 # major version. "4", would be the output for the example.
murgatroid99fd994f12015-10-09 14:02:28 -070051 'defines': [
52 'TSI_OPENSSL_ALPN_SUPPORT=<!(node -v | grep -oP "(?<=v)(\d+)(?=\.\d+\.\d+)")'
53 ],
54 'include_dirs': [
55 '.',
56 'include'
57 ]
58 },
59 'targets': [
60 {
61 'target_name': 'gpr',
62 'product_prefix': 'lib',
63 'type': 'static_library',
64 'dependencies': [
65 ],
66 'sources': [
Craig Tiller95190092015-10-10 20:06:35 -070067 'src/core/profiling/basic_timers.c',
68 'src/core/profiling/stap_timers.c',
murgatroid99fd994f12015-10-09 14:02:28 -070069 'src/core/support/alloc.c',
70 'src/core/support/cmdline.c',
71 'src/core/support/cpu_iphone.c',
72 'src/core/support/cpu_linux.c',
73 'src/core/support/cpu_posix.c',
74 'src/core/support/cpu_windows.c',
75 'src/core/support/env_linux.c',
76 'src/core/support/env_posix.c',
77 'src/core/support/env_win32.c',
78 'src/core/support/file.c',
79 'src/core/support/file_posix.c',
80 'src/core/support/file_win32.c',
81 'src/core/support/histogram.c',
82 'src/core/support/host_port.c',
83 'src/core/support/log.c',
84 'src/core/support/log_android.c',
85 'src/core/support/log_linux.c',
86 'src/core/support/log_posix.c',
87 'src/core/support/log_win32.c',
88 'src/core/support/murmur_hash.c',
89 'src/core/support/slice.c',
90 'src/core/support/slice_buffer.c',
91 'src/core/support/stack_lockfree.c',
92 'src/core/support/string.c',
93 'src/core/support/string_posix.c',
94 'src/core/support/string_win32.c',
95 'src/core/support/subprocess_posix.c',
96 'src/core/support/sync.c',
97 'src/core/support/sync_posix.c',
98 'src/core/support/sync_win32.c',
99 'src/core/support/thd.c',
100 'src/core/support/thd_posix.c',
101 'src/core/support/thd_win32.c',
102 'src/core/support/time.c',
103 'src/core/support/time_posix.c',
Craig Tiller95190092015-10-10 20:06:35 -0700104 'src/core/support/time_precise.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700105 'src/core/support/time_win32.c',
106 'src/core/support/tls_pthread.c',
107 ],
108 },
109 {
110 'target_name': 'grpc',
111 'product_prefix': 'lib',
112 'type': 'static_library',
113 'dependencies': [
114 'gpr',
115 ],
116 'sources': [
117 'src/core/httpcli/httpcli_security_connector.c',
118 'src/core/security/base64.c',
119 'src/core/security/client_auth_filter.c',
120 'src/core/security/credentials.c',
121 'src/core/security/credentials_metadata.c',
122 'src/core/security/credentials_posix.c',
123 'src/core/security/credentials_win32.c',
124 'src/core/security/google_default_credentials.c',
125 'src/core/security/handshake.c',
126 'src/core/security/json_token.c',
127 'src/core/security/jwt_verifier.c',
128 'src/core/security/secure_endpoint.c',
129 'src/core/security/security_connector.c',
130 'src/core/security/security_context.c',
131 'src/core/security/server_auth_filter.c',
132 'src/core/security/server_secure_chttp2.c',
133 'src/core/surface/init_secure.c',
134 'src/core/surface/secure_channel_create.c',
135 'src/core/tsi/fake_transport_security.c',
136 'src/core/tsi/ssl_transport_security.c',
137 'src/core/tsi/transport_security.c',
138 'src/core/census/grpc_context.c',
139 'src/core/census/grpc_filter.c',
140 'src/core/channel/channel_args.c',
141 'src/core/channel/channel_stack.c',
142 'src/core/channel/client_channel.c',
143 'src/core/channel/compress_filter.c',
144 'src/core/channel/connected_channel.c',
145 'src/core/channel/http_client_filter.c',
146 'src/core/channel/http_server_filter.c',
147 'src/core/channel/noop_filter.c',
148 'src/core/client_config/client_config.c',
149 'src/core/client_config/connector.c',
150 'src/core/client_config/lb_policies/pick_first.c',
151 'src/core/client_config/lb_policies/round_robin.c',
152 'src/core/client_config/lb_policy.c',
153 'src/core/client_config/lb_policy_factory.c',
154 'src/core/client_config/lb_policy_registry.c',
155 'src/core/client_config/resolver.c',
156 'src/core/client_config/resolver_factory.c',
157 'src/core/client_config/resolver_registry.c',
158 'src/core/client_config/resolvers/dns_resolver.c',
159 'src/core/client_config/resolvers/sockaddr_resolver.c',
160 'src/core/client_config/subchannel.c',
161 'src/core/client_config/subchannel_factory.c',
162 'src/core/client_config/subchannel_factory_decorators/add_channel_arg.c',
163 'src/core/client_config/subchannel_factory_decorators/merge_channel_args.c',
164 'src/core/client_config/uri_parser.c',
165 'src/core/compression/algorithm.c',
166 'src/core/compression/message_compress.c',
167 'src/core/debug/trace.c',
168 'src/core/httpcli/format_request.c',
169 'src/core/httpcli/httpcli.c',
170 'src/core/httpcli/parser.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700171 'src/core/iomgr/closure.c',
172 'src/core/iomgr/endpoint.c',
173 'src/core/iomgr/endpoint_pair_posix.c',
174 'src/core/iomgr/endpoint_pair_windows.c',
175 'src/core/iomgr/exec_ctx.c',
176 'src/core/iomgr/fd_posix.c',
177 'src/core/iomgr/iocp_windows.c',
178 'src/core/iomgr/iomgr.c',
179 'src/core/iomgr/iomgr_posix.c',
180 'src/core/iomgr/iomgr_windows.c',
181 'src/core/iomgr/pollset_multipoller_with_epoll.c',
182 'src/core/iomgr/pollset_multipoller_with_poll_posix.c',
183 'src/core/iomgr/pollset_posix.c',
184 'src/core/iomgr/pollset_set_posix.c',
185 'src/core/iomgr/pollset_set_windows.c',
186 'src/core/iomgr/pollset_windows.c',
187 'src/core/iomgr/resolve_address_posix.c',
188 'src/core/iomgr/resolve_address_windows.c',
189 'src/core/iomgr/sockaddr_utils.c',
190 'src/core/iomgr/socket_utils_common_posix.c',
191 'src/core/iomgr/socket_utils_linux.c',
192 'src/core/iomgr/socket_utils_posix.c',
193 'src/core/iomgr/socket_windows.c',
194 'src/core/iomgr/tcp_client_posix.c',
195 'src/core/iomgr/tcp_client_windows.c',
196 'src/core/iomgr/tcp_posix.c',
197 'src/core/iomgr/tcp_server_posix.c',
198 'src/core/iomgr/tcp_server_windows.c',
199 'src/core/iomgr/tcp_windows.c',
200 'src/core/iomgr/time_averaged_stats.c',
David Garcia Quintasb65e4212015-10-14 12:00:21 -0700201 'src/core/iomgr/timer.c',
202 'src/core/iomgr/timer_heap.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700203 'src/core/iomgr/udp_server.c',
204 'src/core/iomgr/wakeup_fd_eventfd.c',
205 'src/core/iomgr/wakeup_fd_nospecial.c',
206 'src/core/iomgr/wakeup_fd_pipe.c',
207 'src/core/iomgr/wakeup_fd_posix.c',
208 'src/core/iomgr/workqueue_posix.c',
209 'src/core/iomgr/workqueue_windows.c',
210 'src/core/json/json.c',
211 'src/core/json/json_reader.c',
212 'src/core/json/json_string.c',
213 'src/core/json/json_writer.c',
murgatroid99fd994f12015-10-09 14:02:28 -0700214 'src/core/surface/api_trace.c',
215 'src/core/surface/byte_buffer.c',
216 'src/core/surface/byte_buffer_queue.c',
217 'src/core/surface/byte_buffer_reader.c',
218 'src/core/surface/call.c',
219 'src/core/surface/call_details.c',
220 'src/core/surface/call_log_batch.c',
221 'src/core/surface/channel.c',
222 'src/core/surface/channel_connectivity.c',
223 'src/core/surface/channel_create.c',
224 'src/core/surface/completion_queue.c',
225 'src/core/surface/event_string.c',
226 'src/core/surface/init.c',
227 'src/core/surface/lame_client.c',
228 'src/core/surface/metadata_array.c',
229 'src/core/surface/server.c',
230 'src/core/surface/server_chttp2.c',
231 'src/core/surface/server_create.c',
232 'src/core/surface/version.c',
233 'src/core/transport/chttp2/alpn.c',
234 'src/core/transport/chttp2/bin_encoder.c',
235 'src/core/transport/chttp2/frame_data.c',
236 'src/core/transport/chttp2/frame_goaway.c',
237 'src/core/transport/chttp2/frame_ping.c',
238 'src/core/transport/chttp2/frame_rst_stream.c',
239 'src/core/transport/chttp2/frame_settings.c',
240 'src/core/transport/chttp2/frame_window_update.c',
241 'src/core/transport/chttp2/hpack_parser.c',
242 'src/core/transport/chttp2/hpack_table.c',
243 'src/core/transport/chttp2/huffsyms.c',
244 'src/core/transport/chttp2/incoming_metadata.c',
245 'src/core/transport/chttp2/parsing.c',
246 'src/core/transport/chttp2/status_conversion.c',
247 'src/core/transport/chttp2/stream_encoder.c',
248 'src/core/transport/chttp2/stream_lists.c',
249 'src/core/transport/chttp2/stream_map.c',
250 'src/core/transport/chttp2/timeout_encoding.c',
251 'src/core/transport/chttp2/varint.c',
252 'src/core/transport/chttp2/writing.c',
253 'src/core/transport/chttp2_transport.c',
254 'src/core/transport/connectivity_state.c',
255 'src/core/transport/metadata.c',
256 'src/core/transport/stream_op.c',
257 'src/core/transport/transport.c',
258 'src/core/transport/transport_op_string.c',
259 'src/core/census/context.c',
260 'src/core/census/initialize.c',
261 'src/core/census/operation.c',
262 'src/core/census/tracing.c',
263 ],
264 },
murgatroid992af89e42015-10-01 11:54:00 -0700265 {
266 'include_dirs': [
267 "<!(node -e \"require('nan')\")"
268 ],
269 'cflags': [
270 '-std=c++0x',
271 '-Wall',
272 '-pthread',
273 '-g',
274 '-zdefs',
275 '-Werror',
276 '-Wno-error=deprecated-declarations'
277 ],
278 'ldflags': [
279 '-g'
280 ],
281 "conditions": [
282 ['OS != "win"', {
283 'conditions': [
284 ['config=="gcov"', {
285 'cflags': [
286 '-ftest-coverage',
287 '-fprofile-arcs',
288 '-O0'
289 ],
290 'ldflags': [
291 '-ftest-coverage',
292 '-fprofile-arcs'
293 ]
294 }
295 ]
296 ]
297 }],
298 ['OS == "mac"', {
299 'xcode_settings': {
300 'MACOSX_DEPLOYMENT_TARGET': '10.9',
301 'OTHER_CFLAGS': [
302 '-std=c++11',
303 '-stdlib=libc++'
304 ]
305 }
306 }]
307 ],
308 "target_name": "grpc_node",
309 "sources": [
310 "src/node/ext/byte_buffer.cc",
311 "src/node/ext/call.cc",
murgatroid9947f519e2015-10-07 12:34:24 -0700312 "src/node/ext/call_credentials.cc",
murgatroid992af89e42015-10-01 11:54:00 -0700313 "src/node/ext/channel.cc",
murgatroid9947f519e2015-10-07 12:34:24 -0700314 "src/node/ext/channel_credentials.cc",
murgatroid992af89e42015-10-01 11:54:00 -0700315 "src/node/ext/completion_queue_async_worker.cc",
murgatroid992af89e42015-10-01 11:54:00 -0700316 "src/node/ext/node_grpc.cc",
317 "src/node/ext/server.cc",
318 "src/node/ext/server_credentials.cc",
319 "src/node/ext/timeval.cc"
320 ],
321 "dependencies": [
murgatroid99fd994f12015-10-09 14:02:28 -0700322 "grpc"
murgatroid992af89e42015-10-01 11:54:00 -0700323 ]
324 }
325 ]
326}