Backed out changeset fc094009b7c1 (bug 1318143)

This commit is contained in:
Sebastian Hengst 2017-04-25 22:38:09 +02:00
Родитель de63d72150
Коммит 21f78de4ba
1 изменённых файлов: 3 добавлений и 20 удалений

Просмотреть файл

@ -436,21 +436,12 @@ def get_vc_paths(topsrcdir):
'x86': [os.path.join(tools_path, 'x86'), os.path.join(tools_path, 'x64')],
})
option('--with-visual-studio-version', nargs=1,
choices=('2015', '2017'),
help='Select a specific Visual Studio version to use')
@depends('--with-visual-studio-version')
def vs_major_version(value):
if value:
return {'2015': 14,
'2017': 15}[value[0]]
@depends(host, target, vs_major_version, check_build_environment, '--with-visual-studio-version')
@depends(host, target, check_build_environment)
@imports(_from='__builtin__', _import='sorted')
@imports(_from='operator', _import='itemgetter')
@imports('platform')
def vc_compiler_path(host, target, vs_major_version, env, vs_release_name):
def vc_compiler_path(host, target, env):
if host.kernel != 'WINNT':
return
vc_target = {
@ -461,15 +452,7 @@ def vc_compiler_path(host, target, vs_major_version, env, vs_release_name):
if vc_target is None:
return
all_versions = sorted(get_vc_paths(env.topsrcdir), key=itemgetter(0))
if vs_major_version:
versions = [d for (v, d) in all_versions if v.major == vs_major_version]
if not versions:
die('Visual Studio %s could not be found!' % vs_release_name)
data = versions[0]
else:
# Choose the newest version.
data = all_versions[-1][1]
version, data = sorted(get_vc_paths(env.topsrcdir), key=itemgetter(0))[-1]
paths = data.get(vc_target)
if not paths:
return