Skip to content

Commit

Permalink
gyp: Make it work in Microsoft Visual Studio 2019:
Browse files Browse the repository at this point in the history
- Issue #347 in mediasoup.
- CL uploaded to GYP project:
    https://chromium-review.googlesource.com/c/external/gyp/+/1982599
  • Loading branch information
ibc committed Dec 26, 2019
1 parent dba467b commit d739ef6
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions worker/deps/gyp/pylib/gyp/MSVSVersion.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,12 +263,12 @@ def _CreateVersion(name, path, sdk_based=False):
'2019': VisualStudioVersion('2019',
'Visual Studio 2019',
solution_version='12.00',
project_version='15.0',
project_version='16.0',
flat_sln=False,
uses_vcxproj=True,
path=path,
sdk_based=sdk_based,
default_toolset='v141',
default_toolset='v142',
compatible_sdks=['v8.1', 'v10.0']),
'2017': VisualStudioVersion('2017',
'Visual Studio 2017',
Expand Down Expand Up @@ -409,7 +409,8 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
'11.0': '2012',
'12.0': '2013',
'14.0': '2015',
'15.0': '2017'
'15.0': '2017',
'16.0': '2019'
}
versions = []
for version in versions_to_check:
Expand Down Expand Up @@ -448,9 +449,12 @@ def _DetectVisualStudioVersions(versions_to_check, force_express):
if not path:
continue
path = _ConvertToCygpath(path)
if version == '15.0':
if os.path.exists(path):
versions.append(_CreateVersion('2017', path))
if version == '16.0':
if os.path.exists(path):
versions.append(_CreateVersion('2019', path))
elif version == '15.0':
if os.path.exists(path):
versions.append(_CreateVersion('2017', path))
elif version != '14.0': # There is no Express edition for 2015.
versions.append(_CreateVersion(version_to_year[version] + 'e',
os.path.join(path, '..'), sdk_based=True))
Expand All @@ -470,7 +474,7 @@ def SelectVisualStudioVersion(version='auto', allow_fallback=True):
if version == 'auto':
version = os.environ.get('GYP_MSVS_VERSION', 'auto')
version_map = {
'auto': ('15.0', '14.0', '12.0', '10.0', '9.0', '8.0', '11.0'),
'auto': ('16.0', '15.0', '14.0', '12.0', '10.0', '9.0', '8.0', '11.0'),
'2005': ('8.0',),
'2005e': ('8.0',),
'2008': ('9.0',),
Expand All @@ -483,6 +487,7 @@ def SelectVisualStudioVersion(version='auto', allow_fallback=True):
'2013e': ('12.0',),
'2015': ('14.0',),
'2017': ('15.0',),
'2019': ('16.0',),
}
override_path = os.environ.get('GYP_MSVS_OVERRIDE_PATH')
if override_path:
Expand Down

0 comments on commit d739ef6

Please sign in to comment.