Skip to content

Commit c2cc2cd

Browse files
legendecastargos
andcommitted
build: add flag to compile V8 with Temporal support
Co-Authored-By: Michaël Zasso <targos@protonmail.com>
1 parent 45f5ea3 commit c2cc2cd

File tree

4 files changed

+38
-0
lines changed

4 files changed

+38
-0
lines changed

configure.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,12 @@
10091009
default=None,
10101010
help='Enable the built-in snapshot compression in V8.')
10111011

1012+
parser.add_argument('--v8-enable-temporal-support',
1013+
action='store_true',
1014+
dest='v8_enable_temporal_support',
1015+
default=None,
1016+
help='Enable Temporal support in V8.')
1017+
10121018
parser.add_argument('--node-builtin-modules-path',
10131019
action='store',
10141020
dest='node_builtin_modules_path',
@@ -1816,6 +1822,7 @@ def configure_v8(o, configs):
18161822
o['variables']['v8_enable_external_code_space'] = 1 if options.enable_pointer_compression else 0
18171823
o['variables']['v8_enable_31bit_smis_on_64bit_arch'] = 1 if options.enable_pointer_compression else 0
18181824
o['variables']['v8_enable_extensible_ro_snapshot'] = 0
1825+
o['variables']['v8_enable_temporal_support'] = 1 if options.v8_enable_temporal_support else 0
18191826
o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0
18201827
o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform)
18211828
o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8)

node.gyp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -572,6 +572,7 @@
572572

573573
'dependencies': [
574574
'deps/histogram/histogram.gyp:histogram',
575+
'deps/temporal/temporal_capi/temporal_capi.gyp:temporal_capi',
575576
],
576577

577578
'msvs_settings': {

tools/v8_gypfiles/features.gypi

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,10 @@
295295
# add a dependency on the ICU library.
296296
'v8_enable_i18n_support%': 1,
297297

298+
# Enable Temporal API. Enabling this feature will
299+
# add a dependency on the temporal_rs library.
300+
'v8_enable_temporal_support%': 0,
301+
298302
# Lite mode disables a number of performance optimizations to reduce memory
299303
# at the cost of performance.
300304
# Sets --DV8_LITE_MODE.
@@ -410,6 +414,9 @@
410414
['v8_enable_i18n_support==1', {
411415
'defines': ['V8_INTL_SUPPORT',],
412416
}],
417+
['v8_enable_temporal_support==1', {
418+
'defines': ['V8_TEMPORAL_SUPPORT',],
419+
}],
413420
# Refs: https://github.com/nodejs/node/pull/23801
414421
# ['v8_enable_handle_zapping==1', {
415422
# 'defines': ['ENABLE_HANDLE_ZAPPING',],

tools/v8_gypfiles/v8.gyp

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "torque_files =.*?v8_enable_webassembly.*?torque_files \\+= ")',
3333
],
3434
}],
35+
['v8_enable_temporal_support==1', {
36+
'torque_files': [
37+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "torque_files =.*?v8_enable_temporal_support.*?torque_files \\+= ")',
38+
],
39+
}],
3540
],
3641
},
3742
'includes': ['toolchain.gypi', 'features.gypi'],
@@ -314,6 +319,11 @@
314319
'<(icu_gyp_path):icuuc',
315320
],
316321
}],
322+
['v8_enable_temporal_support==1', {
323+
'dependencies': [
324+
'../../deps/temporal/temporal_capi/temporal_capi.gyp:temporal_capi',
325+
],
326+
}],
317327
],
318328
}, # v8_initializers_slow
319329
{
@@ -351,6 +361,11 @@
351361
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_initializers.*?v8_enable_webassembly.*?sources \\+= ")',
352362
],
353363
}],
364+
['v8_enable_temporal_support==1', {
365+
'dependencies': [
366+
'../../deps/temporal/temporal_capi/temporal_capi.gyp:temporal_capi',
367+
],
368+
}],
354369
['v8_target_arch=="ia32"', {
355370
'sources': [
356371
'<(V8_ROOT)/src/builtins/ia32/builtins-ia32.cc',
@@ -1122,6 +1137,14 @@
11221137
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_sparkplug.*?sources \\+= ")',
11231138
],
11241139
}],
1140+
['v8_enable_temporal_support==1', {
1141+
'dependencies': [
1142+
'../../deps/temporal/temporal_capi/temporal_capi.gyp:temporal_capi',
1143+
],
1144+
'sources': [
1145+
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_temporal_support.*?sources \\+= ")',
1146+
],
1147+
}],
11251148
['v8_enable_maglev==1', {
11261149
'sources': [
11271150
'<!@pymod_do_main(GN-scraper "<(V8_ROOT)/BUILD.gn" "\\"v8_base_without_compiler.*?v8_enable_maglev.*?sources \\+= ")',

0 commit comments

Comments
 (0)