blob: 1e5b2ea911328f4ec586f6674bf65d51c233508b [file] [log] [blame]
murgatroid992d6d3302015-09-21 13:29:40 -07001%YAML 1.2
2--- |
murgatroid99fd994f12015-10-09 14:02:28 -07003 # GRPC Node gyp file
4 # This currently builds the Node extension and dependencies
murgatroid992d6d3302015-09-21 13:29:40 -07005 # This file has been automatically generated from a template file.
6 # Please look at the templates directory instead.
7 # This file can be regenerated from the template by running
8 # tools/buildgen/generate_projects.sh
9
10 # Copyright 2015, Google Inc.
11 # All rights reserved.
12 #
13 # Redistribution and use in source and binary forms, with or without
14 # modification, are permitted provided that the following conditions are
15 # met:
16 #
17 # * Redistributions of source code must retain the above copyright
18 # notice, this list of conditions and the following disclaimer.
19 # * Redistributions in binary form must reproduce the above
20 # copyright notice, this list of conditions and the following disclaimer
21 # in the documentation and/or other materials provided with the
22 # distribution.
23 # * Neither the name of Google Inc. nor the names of its
24 # contributors may be used to endorse or promote products derived from
25 # this software without specific prior written permission.
26 #
27 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
28 # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
29 # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
30 # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
31 # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
32 # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33 # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
34 # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
35 # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
36 # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37 # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38
39 # Some of this file is built with the help of
40 # https://n8.io/converting-a-c-library-to-gyp/
41 {
murgatroid99fd994f12015-10-09 14:02:28 -070042 'variables': {
43 'config': '<!(echo $CONFIG)'
44 },
murgatroid9938745ef2015-09-21 16:39:37 -070045 # TODO: Finish windows support
murgatroid992d6d3302015-09-21 13:29:40 -070046 'target_defaults': {
murgatroid99fd994f12015-10-09 14:02:28 -070047 # Emperically, Node only exports ALPN symbols if its major version is >0.
48 # io.js always reports versions >0 and always exports ALPN symbols.
murgatroid99ca9db402015-09-21 14:39:09 -070049 'defines': [
murgatroid99fd994f12015-10-09 14:02:28 -070050 'TSI_OPENSSL_ALPN_SUPPORT=<!(node -v | grep -oP "(?<=v)(\d+)(?=\.\d+\.\d+)")'
murgatroid99ca9db402015-09-21 14:39:09 -070051 ],
murgatroid992d6d3302015-09-21 13:29:40 -070052 'include_dirs': [
murgatroid99ca9db402015-09-21 14:39:09 -070053 '.',
murgatroid992d6d3302015-09-21 13:29:40 -070054 'include'
murgatroid99fd994f12015-10-09 14:02:28 -070055 ]
murgatroid992d6d3302015-09-21 13:29:40 -070056 },
57 'targets': [
58 % for lib in libs:
murgatroid99db5b1602015-10-01 13:20:11 -070059 % if lib.name == 'gpr' or lib.name == 'grpc':
murgatroid992d6d3302015-09-21 13:29:40 -070060 {
61 'target_name': '${lib.name}',
62 'product_prefix': 'lib',
63 'type': 'static_library',
64 'dependencies': [
65 % for dep in getattr(lib, 'deps', []):
66 '${dep}',
67 % endfor
68 ],
69 'sources': [
70 % for source in lib.src:
murgatroid99ca9db402015-09-21 14:39:09 -070071 '${source}',
murgatroid992d6d3302015-09-21 13:29:40 -070072 % endfor
murgatroid99ca9db402015-09-21 14:39:09 -070073 ],
murgatroid992d6d3302015-09-21 13:29:40 -070074 },
murgatroid99ca9db402015-09-21 14:39:09 -070075 % endif
murgatroid992d6d3302015-09-21 13:29:40 -070076 % endfor
murgatroid99fd994f12015-10-09 14:02:28 -070077 {
78 'include_dirs': [
79 "<!(node -e \"require('nan')\")"
80 ],
81 'cflags': [
82 '-std=c++0x',
83 '-Wall',
84 '-pthread',
85 '-g',
86 '-zdefs',
87 '-Werror',
88 '-Wno-error=deprecated-declarations'
89 ],
90 'ldflags': [
91 '-g'
92 ],
93 "conditions": [
94 ['OS != "win"', {
95 'conditions': [
96 ['config=="gcov"', {
97 'cflags': [
98 '-ftest-coverage',
99 '-fprofile-arcs',
100 '-O0'
101 ],
102 'ldflags': [
103 '-ftest-coverage',
104 '-fprofile-arcs'
105 ]
106 }
107 ]
108 ]
109 }],
110 ['OS == "mac"', {
111 'xcode_settings': {
112 'MACOSX_DEPLOYMENT_TARGET': '10.9',
113 'OTHER_CFLAGS': [
114 '-std=c++11',
115 '-stdlib=libc++'
116 ]
117 }
118 }]
119 ],
120 "target_name": "grpc_node",
121 "sources": [
122 "src/node/ext/byte_buffer.cc",
123 "src/node/ext/call.cc",
124 "src/node/ext/call_credentials.cc",
125 "src/node/ext/channel.cc",
126 "src/node/ext/channel_credentials.cc",
127 "src/node/ext/completion_queue_async_worker.cc",
128 "src/node/ext/node_grpc.cc",
129 "src/node/ext/server.cc",
130 "src/node/ext/server_credentials.cc",
131 "src/node/ext/timeval.cc"
132 ],
133 "dependencies": [
134 "grpc"
135 ]
136 }
murgatroid992d6d3302015-09-21 13:29:40 -0700137 ]
138 }