Skip to content

Commit 9e6b305

Browse files
committed
build: add --shared-hdr-histogram configure flag
PR-URL: #61280 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
1 parent 0094715 commit 9e6b305

File tree

2 files changed

+64
-11
lines changed

2 files changed

+64
-11
lines changed

configure.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,28 @@
279279
dest='shared_gtest_libpath',
280280
help='a directory to search for the shared googletest DLL')
281281

282+
shared_optgroup.add_argument('--shared-hdr-histogram',
283+
action='store_true',
284+
dest='shared_hdr_histogram',
285+
default=None,
286+
help='link to a shared HdrHistogram DLL instead of static linking')
287+
288+
shared_optgroup.add_argument('--shared-hdr-histogram-includes',
289+
action='store',
290+
dest='shared_hdr_histogram_includes',
291+
help='directory containing HdrHistogram header files')
292+
293+
shared_optgroup.add_argument('--shared-hdr-histogram-libname',
294+
action='store',
295+
dest='shared_hdr_histogram_libname',
296+
default='hdr_histogram',
297+
help='alternative lib name to link to [default: %(default)s]')
298+
299+
shared_optgroup.add_argument('--shared-hdr-histogram-libpath',
300+
action='store',
301+
dest='shared_hdr_histogram_libpath',
302+
help='a directory to search for the shared HdrHistogram DLL')
303+
282304
parser.add_argument('--experimental-http-parser',
283305
action='store_true',
284306
dest='experimental_http_parser',
@@ -2321,6 +2343,7 @@ def make_bin_override():
23212343
configure_library('brotli', output, pkgname=['libbrotlidec', 'libbrotlienc'])
23222344
configure_library('cares', output, pkgname='libcares')
23232345
configure_library('gtest', output)
2346+
configure_library('hdr_histogram', output)
23242347
configure_library('nghttp2', output, pkgname='libnghttp2')
23252348
configure_library('nghttp3', output, pkgname='libnghttp3')
23262349
configure_library('ngtcp2', output, pkgname='libngtcp2')

node.gyp

Lines changed: 41 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
'node_shared_brotli%': 'false',
1616
'node_shared_cares%': 'false',
1717
'node_shared_gtest%': 'false',
18+
'node_shared_hdr_histogram%': 'false',
1819
'node_shared_http_parser%': 'false',
1920
'node_shared_libuv%': 'false',
2021
'node_shared_nghttp2%': 'false',
@@ -567,10 +568,6 @@
567568
'src/node_main.cc'
568569
],
569570

570-
'dependencies': [
571-
'deps/histogram/histogram.gyp:histogram',
572-
],
573-
574571
'msvs_settings': {
575572
'VCLinkerTool': {
576573
'GenerateMapFile': 'true', # /MAP
@@ -592,6 +589,11 @@
592589
'msvs_disabled_warnings!': [4244],
593590

594591
'conditions': [
592+
[ 'node_shared_hdr_histogram=="false"', {
593+
'dependencies': [
594+
'deps/histogram/histogram.gyp:histogram',
595+
],
596+
}],
595597
[ 'error_on_warn=="true"', {
596598
'cflags': ['-Werror'],
597599
'xcode_settings': {
@@ -861,7 +863,6 @@
861863
'<(SHARED_INTERMEDIATE_DIR)' # for node_natives.h
862864
],
863865
'dependencies': [
864-
'deps/histogram/histogram.gyp:histogram',
865866
'deps/nbytes/nbytes.gyp:nbytes',
866867
'tools/v8_gypfiles/abseil.gyp:abseil',
867868
'node_js2c#host',
@@ -929,6 +930,11 @@
929930
'deps/googletest/googletest.gyp:gtest_prod',
930931
],
931932
}],
933+
[ 'node_shared_hdr_histogram=="false"', {
934+
'dependencies': [
935+
'deps/histogram/histogram.gyp:histogram',
936+
],
937+
}],
932938
[ 'node_use_sqlite=="true"', {
933939
'sources': [
934940
'<@(node_sqlite_sources)',
@@ -1071,7 +1077,6 @@
10711077
'type': 'executable',
10721078
'dependencies': [
10731079
'<(node_lib_target_name)',
1074-
'deps/histogram/histogram.gyp:histogram',
10751080
],
10761081

10771082
'includes': [
@@ -1096,6 +1101,11 @@
10961101
'test/fuzzers/fuzz_env.cc',
10971102
],
10981103
'conditions': [
1104+
[ 'node_shared_hdr_histogram=="false"', {
1105+
'dependencies': [
1106+
'deps/histogram/histogram.gyp:histogram',
1107+
],
1108+
}],
10991109
['OS=="linux" or OS=="openharmony"', {
11001110
'ldflags': [ '-fsanitize=fuzzer' ]
11011111
}],
@@ -1114,7 +1124,6 @@
11141124
'type': 'executable',
11151125
'dependencies': [
11161126
'<(node_lib_target_name)',
1117-
'deps/histogram/histogram.gyp:histogram',
11181127
],
11191128
'includes': [
11201129
'node.gypi'
@@ -1137,6 +1146,11 @@
11371146
'test/fuzzers/fuzz_ClientHelloParser.cc',
11381147
],
11391148
'conditions': [
1149+
[ 'node_shared_hdr_histogram=="false"', {
1150+
'dependencies': [
1151+
'deps/histogram/histogram.gyp:histogram',
1152+
],
1153+
}],
11401154
[ 'node_shared_uvwasi=="false"', {
11411155
'dependencies': [ 'deps/uvwasi/uvwasi.gyp:uvwasi' ],
11421156
'include_dirs': [ 'deps/uvwasi/include' ],
@@ -1159,7 +1173,6 @@
11591173
'type': 'executable',
11601174
'dependencies': [
11611175
'<(node_lib_target_name)',
1162-
'deps/histogram/histogram.gyp:histogram',
11631176
'deps/nbytes/nbytes.gyp:nbytes',
11641177
],
11651178
'includes': [
@@ -1188,6 +1201,11 @@
11881201
'deps/googletest/googletest.gyp:gtest_prod',
11891202
],
11901203
}],
1204+
[ 'node_shared_hdr_histogram=="false"', {
1205+
'dependencies': [
1206+
'deps/histogram/histogram.gyp:histogram',
1207+
],
1208+
}],
11911209
[ 'node_shared_uvwasi=="false"', {
11921210
'dependencies': [ 'deps/uvwasi/uvwasi.gyp:uvwasi' ],
11931211
'include_dirs': [ 'deps/uvwasi/include' ],
@@ -1211,7 +1229,6 @@
12111229

12121230
'dependencies': [
12131231
'<(node_lib_target_name)',
1214-
'deps/histogram/histogram.gyp:histogram',
12151232
'deps/nbytes/nbytes.gyp:nbytes',
12161233
'tools/v8_gypfiles/abseil.gyp:abseil',
12171234
],
@@ -1247,6 +1264,11 @@
12471264
[ 'node_shared_gtest=="true"', {
12481265
'libraries': [ '-lgtest_main' ],
12491266
}],
1267+
[ 'node_shared_hdr_histogram=="false"', {
1268+
'dependencies': [
1269+
'deps/histogram/histogram.gyp:histogram',
1270+
],
1271+
}],
12501272
[ 'node_use_openssl=="true"', {
12511273
'defines': [
12521274
'HAVE_OPENSSL=1',
@@ -1307,7 +1329,6 @@
13071329

13081330
'dependencies': [
13091331
'<(node_lib_target_name)',
1310-
'deps/histogram/histogram.gyp:histogram',
13111332
'deps/nbytes/nbytes.gyp:nbytes',
13121333
],
13131334

@@ -1343,6 +1364,11 @@
13431364
'OTHER_LDFLAGS': [ '-Wl,-rpath,@loader_path', ],
13441365
},
13451366
}],
1367+
[ 'node_shared_hdr_histogram=="false"', {
1368+
'dependencies': [
1369+
'deps/histogram/histogram.gyp:histogram',
1370+
],
1371+
}],
13461372
['OS=="win"', {
13471373
'libraries': [
13481374
'Dbghelp.lib',
@@ -1427,7 +1453,6 @@
14271453

14281454
'dependencies': [
14291455
'<(node_lib_target_name)',
1430-
'deps/histogram/histogram.gyp:histogram',
14311456
'deps/nbytes/nbytes.gyp:nbytes',
14321457
],
14331458

@@ -1460,6 +1485,11 @@
14601485
['node_write_snapshot_as_array_literals=="true"', {
14611486
'defines': [ 'NODE_MKSNAPSHOT_USE_ARRAY_LITERALS=1' ],
14621487
}],
1488+
[ 'node_shared_hdr_histogram=="false"', {
1489+
'dependencies': [
1490+
'deps/histogram/histogram.gyp:histogram',
1491+
],
1492+
}],
14631493
[ 'node_use_openssl=="true"', {
14641494
'dependencies': [
14651495
'deps/ncrypto/ncrypto.gyp:ncrypto',

0 commit comments

Comments
 (0)