Upgrade to MSVC 2017

For 32 bit we still use the binary compatible MSVC 2015 prebuilt Qt binaries.
For 64 bit, we change to the MSVC 2017 prebuilt binaries.
Redistributables are in no packaged from MSVC 2017 installs.
This commit is contained in:
Roland Winklmeier
2017-11-16 14:00:48 +01:00
parent e8219efdde
commit ae88a091e6
3 changed files with 27 additions and 14 deletions

View File

@@ -143,12 +143,13 @@ unix:!macx {
############### Install VC runtime ##############
win32-msvc2015 {
win32-msvc* {
PROGRAM_FILES = $$getenv(programfiles(x86))
equals(WORD_SIZE,64) {
vc_redist_target.files *= $$(VS140COMNTOOLS)../../VC/redist/1033/vcredist_x64.exe
vc_redist_target.files *= $$shell_path($$PROGRAM_FILES/Microsoft Visual Studio/2017/Community/VC/Redist/MSVC/14.11.25325/vcredist_x64.exe)
}
equals(WORD_SIZE,32) {
vc_redist_target.files *= $$(VS140COMNTOOLS)../../VC/redist/1033/vcredist_x86.exe
vc_redist_target.files *= $$shell_path($$PROGRAM_FILES/Microsoft Visual Studio/2017/Community/VC/Redist/MSVC/14.11.25325/vcredist_x86.exe)
}
vc_redist_target.path *= $${PREFIX}/vcredist
INSTALLS += vc_redist_target

View File

@@ -244,9 +244,9 @@ class MSVCBuilder(Builder):
os.environ['PATH'] += os.pathsep + self._get_externals_path()
os.environ['PATH'] += os.pathsep + 'C:/Program Files/7-Zip'
if self.word_size == '32':
vs_env = get_vs_env('14.0', 'x86')
vs_env = get_vs_env('VS2017', 'x86')
else:
vs_env = get_vs_env('14.0', 'amd64')
vs_env = get_vs_env('VS2017', 'amd64')
os.environ.update(vs_env)
@@ -257,7 +257,12 @@ class MSVCBuilder(Builder):
return path.abspath(path.join(self._get_qtcreator_path(), 'jom.exe'))
def _get_qt_component(self):
return 'msvc2015'
if self.word_size == '32':
return 'msvc2015'
elif self.word_size == '64':
return 'msvc2017'
else:
raise RuntimeError('Illegal word size!')
def __init__(self, config_file, word_size):
Builder.__init__(self, config_file, word_size)

View File

@@ -60,12 +60,19 @@ def get_environment_from_batch_command(env_cmd, initial=None):
def get_vs_env(vs_version, arch):
"""
Returns the env object for VS building environment.
"""
Returns the env object for VS building environment.
The vs_version can be strings like "12.0" (e.g. VS2013), 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.
"""
vsvarsall = "C:\\Program Files (x86)\\Microsoft Visual Studio {0}\\VC\\vcvarsall.bat".format(vs_version)
return get_environment_from_batch_command([vsvarsall, arch])
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.
"""
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!')
return get_environment_from_batch_command([vsvarsall, arch])