@@ -489,6 +489,12 @@ parser.add_option('-C',
489489 dest = 'compile_commands_json' ,
490490 help = optparse .SUPPRESS_HELP )
491491
492+ parser .add_option ('--verbose' ,
493+ action = 'store_true' ,
494+ dest = 'verbose' ,
495+ default = False ,
496+ help = 'make output more verbose' )
497+
492498(options , args ) = parser .parse_args ()
493499
494500# Expand ~ in the install prefix now, it gets written to multiple files.
@@ -1004,10 +1010,21 @@ def configure_static(o):
10041010 if options .enable_asan :
10051011 o ['libraries' ] += ['-static-libasan' ]
10061012
1013+ def config_vs2017 (o ):
1014+ if os .environ .get ('VisualStudioVersion' ) != '15.0' : return
1015+ sdk_ver = os .environ .get ('WindowsSDKVersion' , '' ).rstrip ("\\ " )
1016+ if not sdk_ver :
1017+ print (' Error: could not find a compatible SDK, ' +
1018+ 'make sure you have either a Windows 10 or 8.1 SDK installed' )
1019+ sys .exit (1 )
1020+ o ['msvs_windows_target_platform_version' ] = sdk_ver
1021+ o ['msbuild_toolset' ] = 'v141'
1022+
10071023
10081024def write (filename , data ):
10091025 filename = os .path .join (root_dir , filename )
1010- print ('creating %s' % filename )
1026+ if options .verbose :
1027+ print ('creating %s' % filename )
10111028 f = open (filename , 'w+' )
10121029 f .write (data )
10131030
@@ -1027,7 +1044,8 @@ def glob_to_var(dir_base, dir_sub, patch_dir):
10271044 patchfile = '%s/%s/%s' % (dir_base , patch_dir , file )
10281045 if os .path .isfile (patchfile ):
10291046 srcfile = '%s/%s' % (patch_dir , file )
1030- print ('Using version-specific floating patch %s' % patchfile )
1047+ if options .verbose :
1048+ print ('Using version-specific floating patch %s' % patchfile )
10311049 list .append (srcfile )
10321050 break
10331051 return list
@@ -1054,11 +1072,14 @@ def configure_intl(o):
10541072 if nodedownload .candownload (auto_downloads , "icu" ):
10551073 nodedownload .retrievefile (url , targetfile )
10561074 else :
1057- print ('Re-using existing %s' % targetfile )
1075+ if options .verbose :
1076+ print ('Re-using existing %s' % targetfile )
10581077 if os .path .isfile (targetfile ):
1059- print ('Checking file integrity with MD5:\r ' )
1078+ if options .verbose :
1079+ print ('Checking file integrity with MD5:\r ' )
10601080 gotmd5 = nodedownload .md5sum (targetfile )
1061- print ('MD5: %s %s' % (gotmd5 , targetfile ))
1081+ if options .verbose :
1082+ print ('MD5: %s %s' % (gotmd5 , targetfile ))
10621083 if (md5 == gotmd5 ):
10631084 return targetfile
10641085 else :
@@ -1073,8 +1094,7 @@ def configure_intl(o):
10731094 return
10741095
10751096 # write an empty file to start with
1076- write (icu_config_name , do_not_edit +
1077- pprint .pformat (icu_config , indent = 2 ) + '\n ' )
1097+ write (icu_config_name , do_not_edit + pprint .pformat (icu_config , indent = 2 ) + '\n ' )
10781098
10791099 # always set icu_small, node.gyp depends on it being defined.
10801100 o ['variables' ]['icu_small' ] = b (False )
@@ -1220,7 +1240,8 @@ def configure_intl(o):
12201240 print ('(Fix, or disable with "--with-intl=none" )' )
12211241 sys .exit (1 )
12221242 else :
1223- print ('* Using ICU in %s' % icu_full_path )
1243+ if options .verbose :
1244+ print ('* Using ICU in %s' % icu_full_path )
12241245 # Now, what version of ICU is it? We just need the "major", such as 54.
12251246 # uvernum.h contains it as a #define.
12261247 uvernum_h = os .path .join (icu_full_path , 'source/common/unicode/uvernum.h' )
@@ -1284,8 +1305,7 @@ def configure_intl(o):
12841305 path = '../../%s/source/%s' % (icu_full_path , icu_src [i ])
12851306 icu_config ['variables' ][var ] = glob_to_var ('tools/icu' , path , 'patches/%s/source/%s' % (icu_ver_major , icu_src [i ]) )
12861307 # write updated icu_config.gypi with a bunch of paths
1287- write (icu_config_name , do_not_edit +
1288- pprint .pformat (icu_config , indent = 2 ) + '\n ' )
1308+ write (icu_config_name , do_not_edit + pprint .pformat (icu_config , indent = 2 ) + '\n ' )
12891309 return # end of configure_intl
12901310
12911311def configure_inspector (o ):
@@ -1325,6 +1345,7 @@ configure_openssl(output)
13251345configure_intl (output )
13261346configure_static (output )
13271347configure_inspector (output )
1348+ config_vs2017 (output )
13281349
13291350# variables should be a root level element,
13301351# move everything else to target_defaults
@@ -1337,8 +1358,7 @@ config_fips = { 'make_global_settings' : [] }
13371358if 'make_fips_settings' in output :
13381359 config_fips ['make_global_settings' ] = output ['make_fips_settings' ]
13391360 del output ['make_fips_settings' ]
1340- write ('config_fips.gypi' , do_not_edit +
1341- pprint .pformat (config_fips , indent = 2 ) + '\n ' )
1361+ write ('config_fips.gypi' , do_not_edit + pprint .pformat (config_fips , indent = 2 ) + '\n ' )
13421362
13431363# make_global_settings should be a root level element too
13441364if 'make_global_settings' in output :
@@ -1354,10 +1374,10 @@ output = {
13541374if make_global_settings :
13551375 output ['make_global_settings' ] = make_global_settings
13561376
1357- pprint .pprint (output , indent = 2 )
1358-
1359- write ( 'config.gypi' , do_not_edit +
1360- pprint . pformat ( output , indent = 2 ) + '\n ' )
1377+ config_content = pprint .pformat (output , indent = 2 )
1378+ if options . verbose :
1379+ print ( config_content )
1380+ write ( 'config.gypi' , do_not_edit + config_content + '\n ' )
13611381
13621382config = {
13631383 'BUILDTYPE' : 'Debug' if options .debug else 'Release' ,
@@ -1387,6 +1407,9 @@ else:
13871407if options .compile_commands_json :
13881408 gyp_args += ['-f' , 'compile_commands_json' ]
13891409
1410+ if options .verbose :
1411+ gyp_args += ['--verbose' ]
1412+
13901413gyp_args += args
13911414
13921415if warn .warned :
0 commit comments