Skip to content

Commit 8f28fa8

Browse files
committed
build: add --shared-abseil-cpp configure flag
1 parent d14b484 commit 8f28fa8

File tree

5 files changed

+74
-15
lines changed

5 files changed

+74
-15
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1249,6 +1249,7 @@ ifeq ($(SKIP_SHARED_DEPS), 1)
12491249
$(RM) -r $(TARNAME)/deps/sqlite
12501250
$(RM) -r $(TARNAME)/deps/uv
12511251
$(RM) -r $(TARNAME)/deps/uvwasi
1252+
$(RM) -r $(TARNAME)/deps/v8/third_party/abseil-cpp
12521253
$(RM) -r $(TARNAME)/deps/zlib
12531254
$(RM) -r $(TARNAME)/deps/zstd
12541255
else

configure.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -557,6 +557,28 @@
557557
help='a directory to search for the shared simdutf DLL')
558558

559559

560+
shared_optgroup.add_argument('--shared-abseil-cpp',
561+
action='store_true',
562+
dest='shared_abseil',
563+
default=None,
564+
help='link to a shared abseil DLL instead of static linking')
565+
566+
shared_optgroup.add_argument('--shared-abseil-cpp-includes',
567+
action='store',
568+
dest='shared_abseil',
569+
help='directory containing abseil header files')
570+
571+
shared_optgroup.add_argument('--shared-abseil-cpp-libname',
572+
action='store',
573+
dest='shared_abseil',
574+
default='abseil',
575+
help='alternative lib name to link to [default: %(default)s]')
576+
577+
shared_optgroup.add_argument('--shared-abseil-cpp-libpath',
578+
action='store',
579+
dest='shared_abseil',
580+
help='a directory to search for the shared abseil DLL')
581+
560582
shared_optgroup.add_argument('--shared-ada',
561583
action='store_true',
562584
dest='shared_ada',
@@ -2551,6 +2573,7 @@ def make_bin_override():
25512573
configure_library('zlib', output)
25522574
configure_library('http_parser', output, pkgname='libllhttp')
25532575
configure_library('libuv', output)
2576+
configure_library('abseil', output)
25542577
configure_library('ada', output)
25552578
configure_library('simdjson', output)
25562579
configure_library('simdutf', output)

node.gyp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
'node_lib_target_name%': 'libnode',
1313
'node_module_version%': '',
1414
'node_no_browser_globals%': 'false',
15+
'node_shared_abseil%': 'false',
1516
'node_shared_brotli%': 'false',
1617
'node_shared_cares%': 'false',
1718
'node_shared_gtest%': 'false',

tools/nix/sharedLibDeps.nix

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
}:
77
{
88
inherit (pkgs)
9+
abseil-cpp
910
ada
1011
brotli
1112
gtest

tools/v8_gypfiles/v8.gyp

Lines changed: 48 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -286,11 +286,15 @@
286286
'v8_initializers',
287287
'v8_maybe_icu',
288288
'fp16',
289-
'abseil.gyp:abseil',
290289
],
291290
'sources': [
292291
'<(V8_ROOT)/src/init/setup-isolate-full.cc',
293292
],
293+
'conditions': [
294+
['node_shared_abseil=="false"', {
295+
'dependencies': ['abseil.gyp:abseil'],
296+
}],
297+
],
294298
}, # v8_init
295299
{
296300
# This target is used to work around a GCC issue that causes the
@@ -303,7 +307,6 @@
303307
'generate_bytecode_builtins_list',
304308
'run_torque',
305309
'fp16',
306-
'abseil.gyp:abseil',
307310
],
308311
'cflags!': ['-O3'],
309312
'cflags': ['-O1'],
@@ -314,6 +317,9 @@
314317
'<(SHARED_INTERMEDIATE_DIR)/torque-generated/src/builtins/wasm-to-js-tq-csa.cc',
315318
],
316319
'conditions': [
320+
['node_shared_abseil=="false"', {
321+
'dependencies': ['abseil.gyp:abseil'],
322+
}],
317323
['v8_enable_i18n_support==1', {
318324
'dependencies': [
319325
'<(icu_gyp_path):icui18n',
@@ -337,7 +343,6 @@
337343
'v8_shared_internal_headers',
338344
'v8_pch',
339345
'fp16',
340-
'abseil.gyp:abseil',
341346
],
342347
'include_dirs': [
343348
'<(SHARED_INTERMEDIATE_DIR)',
@@ -347,6 +352,9 @@
347352
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_initializers.*?sources = ")',
348353
],
349354
'conditions': [
355+
['node_shared_abseil=="false"', {
356+
'dependencies': ['abseil.gyp:abseil'],
357+
}],
350358
['v8_enable_webassembly==1', {
351359
'dependencies': [
352360
'v8_initializers_slow',
@@ -534,7 +542,6 @@
534542
'v8_compiler_for_mksnapshot',
535543
'v8_initializers',
536544
'v8_libplatform',
537-
'abseil.gyp:abseil',
538545
'fp16',
539546
]
540547
}, {
@@ -548,10 +555,12 @@
548555
'v8_compiler_for_mksnapshot',
549556
'v8_initializers',
550557
'v8_libplatform',
551-
'abseil.gyp:abseil',
552558
'fp16',
553559
]
554560
}],
561+
['node_shared_abseil=="false"', {
562+
'dependencies': ['abseil.gyp:abseil'],
563+
}],
555564
['OS=="win" and clang==1', {
556565
'actions': [
557566
{
@@ -664,13 +673,15 @@
664673
'run_torque',
665674
'v8_libbase',
666675
'fp16',
667-
'abseil.gyp:abseil',
668676
],
669677
'direct_dependent_settings': {
670678
'sources': [
671679
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?sources = ")',
672680
],
673681
'conditions': [
682+
['node_shared_abseil=="false"', {
683+
'dependencies': ['abseil.gyp:abseil'],
684+
}],
674685
['v8_enable_snapshot_compression==1', {
675686
'sources': [
676687
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?v8_enable_snapshot_compression.*?sources \\+= ")',
@@ -998,9 +1009,11 @@
9981009
'v8_shared_internal_headers',
9991010
'v8_pch',
10001011
'fp16',
1001-
'abseil.gyp:abseil',
10021012
],
10031013
'conditions': [
1014+
['node_shared_abseil=="false"', {
1015+
'dependencies': ['abseil.gyp:abseil'],
1016+
}],
10041017
['v8_enable_maglev==0', {
10051018
'sources': [
10061019
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "v8_header_set.\\"v8_internal_headers\\".*?!v8_enable_maglev.*?sources \\+= ")',
@@ -1116,7 +1129,6 @@
11161129
'fp16',
11171130
'highway',
11181131
'simdutf',
1119-
'abseil.gyp:abseil',
11201132
],
11211133
'includes': ['inspector.gypi'],
11221134
'direct_dependent_settings': {
@@ -1133,6 +1145,9 @@
11331145
'<@(inspector_all_sources)',
11341146
],
11351147
'conditions': [
1148+
['node_shared_abseil=="false"', {
1149+
'dependencies': ['abseil.gyp:abseil'],
1150+
}],
11361151
['v8_enable_snapshot_compression==1', {
11371152
'sources': [
11381153
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_snapshot_compression.*?sources \\+= ")',
@@ -1411,13 +1426,17 @@
14111426
'dependencies': [
14121427
'v8_shared_internal_headers',
14131428
'v8_libbase',
1414-
'abseil.gyp:abseil',
14151429
],
14161430
'defines!': [
14171431
'_HAS_EXCEPTIONS=0',
14181432
'BUILDING_V8_SHARED=1',
14191433
'BUILDING_V8_PLATFORM_SHARED=1',
14201434
],
1435+
'conditions': [
1436+
['node_shared_abseil=="false"', {
1437+
'dependencies': ['abseil.gyp:abseil'],
1438+
}],
1439+
],
14211440
'cflags_cc!': ['-fno-exceptions'],
14221441
'cflags_cc': ['-fexceptions'],
14231442
'xcode_settings': {
@@ -1467,10 +1486,12 @@
14671486

14681487
'dependencies': [
14691488
'v8_headers',
1470-
'abseil.gyp:abseil',
14711489
],
14721490

14731491
'conditions': [
1492+
['node_shared_abseil=="false"', {
1493+
'dependencies': ['abseil.gyp:abseil'],
1494+
}],
14741495
['is_component_build', {
14751496
'defines': ["BUILDING_V8_BASE_SHARED"],
14761497
}],
@@ -1716,12 +1737,14 @@
17161737
'toolsets': ['host', 'target'],
17171738
'dependencies': [
17181739
'v8_libbase',
1719-
'abseil.gyp:abseil',
17201740
],
17211741
'sources': [
17221742
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_libplatform.*?sources = ")',
17231743
],
17241744
'conditions': [
1745+
['node_shared_abseil=="false"', {
1746+
'dependencies': ['abseil.gyp:abseil'],
1747+
}],
17251748
['component=="shared_library"', {
17261749
'direct_dependent_settings': {
17271750
'defines': ['USING_V8_PLATFORM_SHARED'],
@@ -1789,7 +1812,6 @@
17891812
],
17901813
'dependencies': [
17911814
'v8_libbase',
1792-
'abseil.gyp:abseil',
17931815
# "build/win:default_exe_manifest",
17941816
],
17951817
'sources': [
@@ -1800,6 +1822,11 @@
18001822
"<(V8_ROOT)/src/interpreter/bytecodes.cc",
18011823
"<(V8_ROOT)/src/interpreter/bytecodes.h",
18021824
],
1825+
'conditions': [
1826+
['node_shared_abseil=="false"', {
1827+
'dependencies': ['abseil.gyp:abseil'],
1828+
}],
1829+
],
18031830
}, # bytecode_builtins_list_generator
18041831
{
18051832
'target_name': 'mksnapshot',
@@ -1813,7 +1840,6 @@
18131840
'v8_maybe_icu',
18141841
'v8_pch',
18151842
'fp16',
1816-
'abseil.gyp:abseil',
18171843
# "build/win:default_exe_manifest",
18181844
],
18191845
'sources': [
@@ -1838,6 +1864,9 @@
18381864
},
18391865
},
18401866
'conditions': [
1867+
['node_shared_abseil=="false"', {
1868+
'dependencies': ['abseil.gyp:abseil'],
1869+
}],
18411870
['want_separate_host_toolset', {
18421871
'toolsets': ['host'],
18431872
}],
@@ -1852,10 +1881,12 @@
18521881
'type': 'executable',
18531882
'dependencies': [
18541883
'torque_base',
1855-
'abseil.gyp:abseil',
18561884
# "build/win:default_exe_manifest",
18571885
],
18581886
'conditions': [
1887+
['node_shared_abseil=="false"', {
1888+
'dependencies': ['abseil.gyp:abseil'],
1889+
}],
18591890
['want_separate_host_toolset', {
18601891
'toolsets': ['host'],
18611892
}],
@@ -1930,9 +1961,11 @@
19301961
'v8_libbase',
19311962
# "build/win:default_exe_manifest",
19321963
'v8_maybe_icu',
1933-
'abseil.gyp:abseil',
19341964
],
19351965
'conditions': [
1966+
['node_shared_abseil=="false"', {
1967+
'dependencies': ['abseil.gyp:abseil'],
1968+
}],
19361969
['want_separate_host_toolset', {
19371970
'toolsets': ['host'],
19381971
}],

0 commit comments

Comments
 (0)