Skip to content

Commit 961e949

Browse files
author
Jeroen Roovers
committed
http2: Allow using a shared nghttp2 library
1 parent be63c26 commit 961e949

File tree

2 files changed

+32
-9
lines changed

2 files changed

+32
-9
lines changed

configure

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,27 @@ shared_optgroup.add_option('--shared-http-parser-libpath',
182182
dest='shared_http_parser_libpath',
183183
help='a directory to search for the shared http_parser DLL')
184184

185+
shared_optgroup.add_option('--shared-nghttp2',
186+
action='store_true',
187+
dest='shared_nghttp2',
188+
help='link to a shared nghttp2 DLL instead of static linking')
189+
190+
shared_optgroup.add_option('--shared-nghttp2-includes',
191+
action='store',
192+
dest='shared_nghttp2_includes',
193+
help='directory containing nghttp2 header files')
194+
195+
shared_optgroup.add_option('--shared-nghttp2-libname',
196+
action='store',
197+
dest='shared_nghttp2_libname',
198+
default='nghttp2',
199+
help='alternative lib name to link to [default: %default]')
200+
201+
shared_optgroup.add_option('--shared-nghttp2-libpath',
202+
action='store',
203+
dest='shared_nghttp2_libpath',
204+
help='a directory to search for the shared nghttp2 DLL')
205+
185206
shared_optgroup.add_option('--shared-libuv',
186207
action='store_true',
187208
dest='shared_libuv',
@@ -1360,6 +1381,7 @@ flavor = GetFlavor(flavor_params)
13601381
configure_node(output)
13611382
configure_library('zlib', output)
13621383
configure_library('http_parser', output)
1384+
configure_library('nghttp2', output)
13631385
configure_library('libuv', output)
13641386
configure_library('libcares', output)
13651387
# stay backwards compatible with shared cares builds

node.gyp

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
'node_module_version%': '',
1515
'node_shared_zlib%': 'false',
1616
'node_shared_http_parser%': 'false',
17+
'node_shared_nghttp2%': 'false',
1718
'node_shared_cares%': 'false',
1819
'node_shared_libuv%': 'false',
1920
'node_use_openssl%': 'true',
@@ -149,11 +150,6 @@
149150
'target_name': '<(node_core_target_name)',
150151
'type': '<(node_target_type)',
151152

152-
'dependencies': [
153-
'node_js2c#host',
154-
'deps/nghttp2/nghttp2.gyp:nghttp2'
155-
],
156-
157153
'includes': [
158154
'node.gypi'
159155
],
@@ -162,8 +158,7 @@
162158
'src',
163159
'tools/msvs/genfiles',
164160
'deps/uv/src/ares',
165-
'<(SHARED_INTERMEDIATE_DIR)', # for node_natives.h
166-
'deps/nghttp2/lib/includes'
161+
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
167162
],
168163

169164
'sources': [
@@ -276,8 +271,6 @@
276271
'NODE_WANT_INTERNALS=1',
277272
# Warn when using deprecated V8 APIs.
278273
'V8_DEPRECATION_WARNINGS=1',
279-
# We're using the nghttp2 static lib
280-
'NGHTTP2_STATICLIB'
281274
],
282275
},
283276
{
@@ -689,6 +682,14 @@
689682
'deps/http_parser/http_parser.gyp:http_parser'
690683
]
691684
}],
685+
[ 'node_shared_nghttp2=="false"', {
686+
'dependencies': [
687+
'deps/nghttp2/nghttp2.gyp:nghttp2'
688+
],
689+
'include_dirs': [
690+
'deps/nghttp2/lib/includes'
691+
]
692+
}],
692693
[ 'node_shared_libuv=="false"', {
693694
'dependencies': [
694695
'deps/uv/uv.gyp:libuv'

0 commit comments

Comments
 (0)