[Jenkins] vs_version argument not needed in get_vs_env.

This commit is contained in:
Roland Rossgotterer
2019-02-13 12:17:43 +01:00
committed by Mat Sutcliffe
parent 08578e202a
commit 1a30e24652
2 changed files with 6 additions and 14 deletions

View File

@@ -262,9 +262,9 @@ class MSVCBuilder(Builder):
os.environ['PATH'] += os.pathsep + self._get_externals_path() #TODO still needed? we copy externals anyway
os.environ['PATH'] += os.pathsep + 'C:/Program Files/7-Zip'
if self.word_size == '32':
vs_env = get_vs_env('VS2017', 'x86')
vs_env = get_vs_env('x86')
else:
vs_env = get_vs_env('VS2017', 'amd64')
vs_env = get_vs_env('amd64')
os.environ.update(vs_env)

View File

@@ -60,20 +60,12 @@ def get_environment_from_batch_command(env_cmd, initial=None):
return result
def get_vs_env(vs_version, arch):
def get_vs_env(arch):
"""
Returns the env object for VS building environment.
The vs_version can be one of the following strings:
- VS2015,
- VS2017,
the arch has to be one of "x86", "amd64", "arm", "x86_amd64", "x86_arm", "amd64_x86",
"amd64_arm", e.g. the args passed to vcvarsall.bat.
The arch has to be one of "x86", "amd64", "arm", "x86_amd64", "x86_arm", "amd64_x86",
"amd64_arm", i.e. the args passed to vcvarsall.bat.
"""
if vs_version == 'VS2015':
vsvarsall = "C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\vcvarsall.bat"
elif vs_version == 'VS2017':
vsvarsall = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\Auxiliary\\Build\\vcvarsall.bat"
else:
raise RuntimeError('Unsupported Visual Studio version!')
vsvarsall = "C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\Auxiliary\\Build\\vcvarsall.bat"
return get_environment_from_batch_command([vsvarsall, arch])