@@ -86,6 +86,10 @@ def _SetupScriptInternal(self, target_arch):
86
86
# vcvars32, which it can only find if VS??COMNTOOLS is set, which it
87
87
# isn't always.
88
88
if target_arch == 'x86' :
89
+ if self .short_name == '2017' :
90
+ return [os .path .normpath (
91
+ ps .path .join (self .path , 'Common7/Tools/VsDevCmd.bat' )), '/no_logo' ,
92
+ '/arch=x86' ]
89
93
if self .short_name >= '2013' and self .short_name [- 1 ] != 'e' and (
90
94
os .environ .get ('PROCESSOR_ARCHITECTURE' ) == 'AMD64' or
91
95
os .environ .get ('PROCESSOR_ARCHITEW6432' ) == 'AMD64' ):
@@ -98,6 +102,10 @@ def _SetupScriptInternal(self, target_arch):
98
102
os .path .join (self .path , 'Common7/Tools/vsvars32.bat' ))]
99
103
else :
100
104
assert target_arch == 'x64'
105
+ if self .short_name == '2017' :
106
+ return [os .path .normpath (
107
+ ps .path .join (self .path , 'Common7/Tools/VsDevCmd.bat' )), '/no_logo' ,
108
+ '/arch=x64' ]
101
109
arg = 'x86_amd64'
102
110
# Use the 64-on-64 compiler if we're not using an express
103
111
# edition and we're running on a 64bit OS.
@@ -236,6 +244,15 @@ def _CreateVersion(name, path, sdk_based=False):
236
244
if path :
237
245
path = os .path .normpath (path )
238
246
versions = {
247
+ '2017' : VisualStudioVersion ('2017' ,
248
+ 'Visual Studio 2017' ,
249
+ solution_version = '12.00' ,
250
+ project_version = '14.0' ,
251
+ flat_sln = False ,
252
+ uses_vcxproj = True ,
253
+ path = path ,
254
+ sdk_based = sdk_based ,
255
+ default_toolset = 'v141' ),
239
256
'2015' : VisualStudioVersion ('2015' ,
240
257
'Visual Studio 2015' ,
241
258
solution_version = '12.00' ,
@@ -356,6 +373,7 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
356
373
2012(e) - Visual Studio 2012 (11)
357
374
2013(e) - Visual Studio 2013 (12)
358
375
2015 - Visual Studio 2015 (14)
376
+ 2017 - Visual Studio 2017 (15)
359
377
Where (e) is e for express editions of MSVS and blank otherwise.
360
378
"""
361
379
version_to_year = {
@@ -365,6 +383,7 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
365
383
'11.0' : '2012' ,
366
384
'12.0' : '2013' ,
367
385
'14.0' : '2015' ,
386
+ '15.0' : '2017'
368
387
}
369
388
versions = []
370
389
for version in versions_to_check :
@@ -395,13 +414,18 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
395
414
396
415
# The old method above does not work when only SDK is installed.
397
416
keys = [r'HKLM\Software\Microsoft\VisualStudio\SxS\VC7' ,
398
- r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7' ]
417
+ r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VC7' ,
418
+ r'HKLM\Software\Microsoft\VisualStudio\SxS\VS7' ,
419
+ r'HKLM\Software\Wow6432Node\Microsoft\VisualStudio\SxS\VS7' ]
399
420
for index in range (len (keys )):
400
421
path = _RegistryGetValue (keys [index ], version )
401
422
if not path :
402
423
continue
403
424
path = _ConvertToCygpath (path )
404
- if version != '14.0' : # There is no Express edition for 2015.
425
+ if version == '15.0' :
426
+ if os .path .exists (path ):
427
+ versions .append (_CreateVersion ('2017' , path ))
428
+ elif version != '14.0' : # There is no Express edition for 2015.
405
429
versions .append (_CreateVersion (version_to_year [version ] + 'e' ,
406
430
os .path .join (path , '..' ), sdk_based = True ))
407
431
@@ -420,7 +444,7 @@ def SelectVisualStudioVersion(version='auto', allow_fallback=True):
420
444
if version == 'auto' :
421
445
version = os .environ .get ('GYP_MSVS_VERSION' , 'auto' )
422
446
version_map = {
423
- 'auto' : ('14.0' , '12.0' , '10.0' , '9.0' , '8.0' , '11.0' ),
447
+ 'auto' : ('15.0' , ' 14.0' , '12.0' , '10.0' , '9.0' , '8.0' , '11.0' ),
424
448
'2005' : ('8.0' ,),
425
449
'2005e' : ('8.0' ,),
426
450
'2008' : ('9.0' ,),
@@ -432,6 +456,7 @@ def SelectVisualStudioVersion(version='auto', allow_fallback=True):
432
456
'2013' : ('12.0' ,),
433
457
'2013e' : ('12.0' ,),
434
458
'2015' : ('14.0' ,),
459
+ '2017' : ('15.0' ,),
435
460
}
436
461
override_path = os .environ .get ('GYP_MSVS_OVERRIDE_PATH' )
437
462
if override_path :
0 commit comments