@@ -55,6 +55,10 @@ sys.path.insert(0, 'tools')
55
55
import getmoduleversion
56
56
from gyp_node import run_gyp
57
57
58
+ # imports in deps/v8/tools/node
59
+ sys.path.insert(0, os.path.join(' deps' , ' v8' , ' tools' , ' node' ))
60
+ from fetch_deps import FetchDeps
61
+
58
62
# parse our options
59
63
parser = optparse.OptionParser ()
60
64
@@ -548,6 +552,12 @@ parser.add_option('--without-bundled-v8',
548
552
help=' do not use V8 includes from the bundled deps folder. ' +
549
553
' (This mode is not officially supported for regular applications)' )
550
554
555
+ parser.add_option(' --build-v8-with-gn' ,
556
+ action=' store_true' ,
557
+ dest=' build_v8_with_gn' ,
558
+ default=False,
559
+ help=' build V8 using GN instead of gyp' )
560
+
551
561
# Create compile_commands.json in out/Debug and out/Release.
552
562
parser.add_option(' -C' ,
553
563
action=' store_true' ,
@@ -1060,6 +1070,14 @@ def configure_v8(o):
1060
1070
o[' variables' ][' test_isolation_mode' ] = ' noop' # Needed by d8.gyp.
1061
1071
if options.without_bundled_v8 and options.enable_d8:
1062
1072
raise Exception(' --enable-d8 is incompatible with --without-bundled-v8.' )
1073
+ if options.without_bundled_v8 and options.build_v8_with_gn:
1074
+ raise Exception(
1075
+ ' --build-v8-with-gn is incompatible with --without-bundled-v8.' )
1076
+ if options.build_v8_with_gn:
1077
+ v8_path = os.path.join(' deps' , ' v8' )
1078
+ print(' Fetching dependencies to build V8 with GN' )
1079
+ options.build_v8_with_gn = FetchDeps(v8_path)
1080
+ o[' variables' ][' build_v8_with_gn' ] = b(options.build_v8_with_gn)
1063
1081
1064
1082
1065
1083
def configure_openssl(o):
0 commit comments