Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion common.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@
'V8_BASE': '<(PRODUCT_DIR)/obj/deps/v8/src/libv8_base.a',
}, {
'OBJ_DIR%': '<(PRODUCT_DIR)/obj.target',
'V8_BASE%': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
'conditions': [
[ 'build_v8_with_gn=="true"', {
'V8_BASE': '<(PRODUCT_DIR)/obj.target/v8_monolith/geni/gn/obj/libv8_monolith.a',
}, {
'V8_BASE': '<(PRODUCT_DIR)/obj.target/deps/v8/src/libv8_base.a',
}],
],
}],
['OS == "win"', {
'os_posix': 0,
Expand Down
18 changes: 18 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ sys.path.insert(0, 'tools')
import getmoduleversion
from gyp_node import run_gyp

# imports in deps/v8/tools/node
sys.path.insert(0, os.path.join('deps', 'v8', 'tools', 'node'))
from fetch_deps import FetchDeps

# parse our options
parser = optparse.OptionParser()

Expand Down Expand Up @@ -548,6 +552,12 @@ parser.add_option('--without-bundled-v8',
help='do not use V8 includes from the bundled deps folder. ' +
'(This mode is not officially supported for regular applications)')

parser.add_option('--build-v8-with-gn',
action='store_true',
dest='build_v8_with_gn',
default=False,
help='build V8 using GN instead of gyp')

# Create compile_commands.json in out/Debug and out/Release.
parser.add_option('-C',
action='store_true',
Expand Down Expand Up @@ -1027,6 +1037,7 @@ def configure_v8(o):
o['variables']['v8_trace_maps'] = 1 if options.trace_maps else 0
o['variables']['node_use_v8_platform'] = b(not options.without_v8_platform)
o['variables']['node_use_bundled_v8'] = b(not options.without_bundled_v8)
o['variables']['build_v8_with_gn'] = b(options.build_v8_with_gn)
o['variables']['force_dynamic_crt'] = 1 if options.shared else 0
o['variables']['node_enable_d8'] = b(options.enable_d8)
# Unconditionally force typed arrays to allocate outside the v8 heap. This
Expand All @@ -1037,6 +1048,13 @@ def configure_v8(o):
o['variables']['test_isolation_mode'] = 'noop' # Needed by d8.gyp.
if options.without_bundled_v8 and options.enable_d8:
raise Exception('--enable-d8 is incompatible with --without-bundled-v8.')
if options.without_bundled_v8 and options.build_v8_with_gn:
raise Exception(
'--build-v8-with-gn is incompatible with --without-bundled-v8.')
if options.build_v8_with_gn:
v8_path = os.path.join('deps', 'v8')
print('Fetching dependencies to build V8 with GN')
FetchDeps(v8_path)


def configure_openssl(o):
Expand Down
8 changes: 7 additions & 1 deletion node.gypi
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,15 @@
}],
[ 'node_use_bundled_v8=="true"', {
'dependencies': [
'deps/v8/src/v8.gyp:v8',
'deps/v8/src/v8.gyp:v8_libplatform'
],
'conditions': [
[ 'build_v8_with_gn=="true"', {
'dependencies': ['deps/v8/src/v8.gyp:v8_monolith'],
}, {
'dependencies': ['deps/v8/src/v8.gyp:v8'],
}],
],
}],
[ 'node_use_v8_platform=="true"', {
'defines': [
Expand Down