Skip to content

Commit cd2afa6

Browse files
committed
build: add --shared-nbytes configure flag
PR-URL: #61341 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: Aviv Keller <me@aviv.sh> Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
1 parent 9e6b305 commit cd2afa6

File tree

2 files changed

+49
-5
lines changed

2 files changed

+49
-5
lines changed

configure.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -351,6 +351,28 @@
351351
dest='shared_libuv_libpath',
352352
help='a directory to search for the shared libuv DLL')
353353

354+
shared_optgroup.add_argument('--shared-nbytes',
355+
action='store_true',
356+
dest='shared_nbytes',
357+
default=None,
358+
help='link to a shared nbytes DLL instead of static linking')
359+
360+
shared_optgroup.add_argument('--shared-nbytes-includes',
361+
action='store',
362+
dest='shared_nbytes_includes',
363+
help='directory containing nbytes header files')
364+
365+
shared_optgroup.add_argument('--shared-nbytes-libname',
366+
action='store',
367+
dest='shared_nbytes_libname',
368+
default='nbytes',
369+
help='alternative lib name to link to [default: %(default)s]')
370+
371+
shared_optgroup.add_argument('--shared-nbytes-libpath',
372+
action='store',
373+
dest='shared_nbytes_libpath',
374+
help='a directory to search for the shared nbytes DLL')
375+
354376
shared_optgroup.add_argument('--shared-nghttp2',
355377
action='store_true',
356378
dest='shared_nghttp2',
@@ -2344,6 +2366,7 @@ def make_bin_override():
23442366
configure_library('cares', output, pkgname='libcares')
23452367
configure_library('gtest', output)
23462368
configure_library('hdr_histogram', output)
2369+
configure_library('nbytes', output)
23472370
configure_library('nghttp2', output, pkgname='libnghttp2')
23482371
configure_library('nghttp3', output, pkgname='libnghttp3')
23492372
configure_library('ngtcp2', output, pkgname='libngtcp2')

node.gyp

Lines changed: 26 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
'node_shared_hdr_histogram%': 'false',
1919
'node_shared_http_parser%': 'false',
2020
'node_shared_libuv%': 'false',
21+
'node_shared_nbytes%': 'false',
2122
'node_shared_nghttp2%': 'false',
2223
'node_shared_openssl%': 'false',
2324
'node_shared_sqlite%': 'false',
@@ -863,7 +864,6 @@
863864
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
864865
],
865866
'dependencies': [
866-
'deps/nbytes/nbytes.gyp:nbytes',
867867
'tools/v8_gypfiles/abseil.gyp:abseil',
868868
'node_js2c#host',
869869
],
@@ -935,6 +935,11 @@
935935
'deps/histogram/histogram.gyp:histogram',
936936
],
937937
}],
938+
[ 'node_shared_nbytes=="false"', {
939+
'dependencies': [
940+
'deps/nbytes/nbytes.gyp:nbytes',
941+
],
942+
}],
938943
[ 'node_use_sqlite=="true"', {
939944
'sources': [
940945
'<@(node_sqlite_sources)',
@@ -1173,7 +1178,6 @@
11731178
'type': 'executable',
11741179
'dependencies': [
11751180
'<(node_lib_target_name)',
1176-
'deps/nbytes/nbytes.gyp:nbytes',
11771181
],
11781182
'includes': [
11791183
'node.gypi'
@@ -1206,6 +1210,11 @@
12061210
'deps/histogram/histogram.gyp:histogram',
12071211
],
12081212
}],
1213+
[ 'node_shared_nbytes=="false"', {
1214+
'dependencies': [
1215+
'deps/nbytes/nbytes.gyp:nbytes',
1216+
],
1217+
}],
12091218
[ 'node_shared_uvwasi=="false"', {
12101219
'dependencies': [ 'deps/uvwasi/uvwasi.gyp:uvwasi' ],
12111220
'include_dirs': [ 'deps/uvwasi/include' ],
@@ -1229,7 +1238,6 @@
12291238

12301239
'dependencies': [
12311240
'<(node_lib_target_name)',
1232-
'deps/nbytes/nbytes.gyp:nbytes',
12331241
'tools/v8_gypfiles/abseil.gyp:abseil',
12341242
],
12351243

@@ -1269,6 +1277,11 @@
12691277
'deps/histogram/histogram.gyp:histogram',
12701278
],
12711279
}],
1280+
[ 'node_shared_nbytes=="false"', {
1281+
'dependencies': [
1282+
'deps/nbytes/nbytes.gyp:nbytes',
1283+
],
1284+
}],
12721285
[ 'node_use_openssl=="true"', {
12731286
'defines': [
12741287
'HAVE_OPENSSL=1',
@@ -1329,7 +1342,6 @@
13291342

13301343
'dependencies': [
13311344
'<(node_lib_target_name)',
1332-
'deps/nbytes/nbytes.gyp:nbytes',
13331345
],
13341346

13351347
'includes': [
@@ -1369,6 +1381,11 @@
13691381
'deps/histogram/histogram.gyp:histogram',
13701382
],
13711383
}],
1384+
[ 'node_shared_nbytes=="false"', {
1385+
'dependencies': [
1386+
'deps/nbytes/nbytes.gyp:nbytes',
1387+
],
1388+
}],
13721389
['OS=="win"', {
13731390
'libraries': [
13741391
'Dbghelp.lib',
@@ -1453,7 +1470,6 @@
14531470

14541471
'dependencies': [
14551472
'<(node_lib_target_name)',
1456-
'deps/nbytes/nbytes.gyp:nbytes',
14571473
],
14581474

14591475
'includes': [
@@ -1490,6 +1506,11 @@
14901506
'deps/histogram/histogram.gyp:histogram',
14911507
],
14921508
}],
1509+
[ 'node_shared_nbytes=="false"', {
1510+
'dependencies': [
1511+
'deps/nbytes/nbytes.gyp:nbytes',
1512+
],
1513+
}],
14931514
[ 'node_use_openssl=="true"', {
14941515
'dependencies': [
14951516
'deps/ncrypto/ncrypto.gyp:ncrypto',

0 commit comments

Comments
 (0)