diff --git a/copy-runtime-files.ps1 b/copy-runtime-files.ps1 index 79e7745ad10c637eb6058480b420f1ea72e032eb..f665b79dd74eed28a35b886cb99927aeb9c65499 100644 --- a/copy-runtime-files.ps1 +++ b/copy-runtime-files.ps1 @@ -19,13 +19,14 @@ If (test-path $stampFile) { # default values $qtver = If ($qtver) { $qtver } Else { "5.15.0" } +$qtMinorVer = $qtver.split('.')[1] $mode = If ($mode) { $mode } Else { "Release" } if (!$outDir) { $outDir = $clientDir + "\x64\" + $mode } If (!(test-path $outDir)) { New-Item -ItemType directory -Path $outDir -Force } $qtverSplit1, $qtverSplit2 , $qtverSplit3 = $qtver.Split('.') -$qtMsvcDir = "msvc2019_64" +$qtMsvcDir = If (([int]$qtMinorVer) -le 14) {"msvc2017_64"} Else {"msvc2019_64"} $QtDir = "C:\Qt\$qtver\$qtMsvcDir" diff --git a/jami-qt.pro b/jami-qt.pro index 947cd37e999c422c3cb2c7004adff98734007649..20dfb4945ace0751aaeca1b82944940c3a81d973 100644 --- a/jami-qt.pro +++ b/jami-qt.pro @@ -6,7 +6,7 @@ win32-msvc { CONFIG += suppress_vcproj_warnings c++17 qtquickcompiler - QTQUICK_COMPILER_SKIPPED_RESOURCES += ./resources.qrc + QTQUICK_COMPILER_SKIPPED_RESOURCES += resources.qrc # compiler options QMAKE_CXXFLAGS += /wd"4068" /wd"4099" /wd"4189" /wd"4267" /wd"4577" /wd"4467" /wd"4715" /wd"4828" diff --git a/make-client.py b/make-client.py index 32b01adef6f4aa8bf0f5760a3542744c0329e669..d27ee1d7e5cf327c7882225f65c36e9668c09611 100644 --- a/make-client.py +++ b/make-client.py @@ -8,10 +8,12 @@ import argparse import multiprocessing import fileinput import re +from enum import Enum # vs help win_sdk_default = '10.0.16299.0' -win_toolset_default = 'v142' +win_toolset_default = '142' +qt_version_default = '5.15.0' vs_where_path = os.path.join( os.environ['ProgramFiles(x86)'], 'Microsoft Visual Studio', 'Installer', 'vswhere.exe' @@ -19,6 +21,10 @@ vs_where_path = os.path.join( host_is_64bit = (False, True)[platform.machine().endswith('64')] +class QtVerison(Enum): + Major = 0 + Minor = 1 + Micro = 2 def execute_cmd(cmd, with_shell=False, env_vars={}): if(bool(env_vars)): @@ -62,6 +68,10 @@ def findVSLatestDir(): return +def getQtVersionNumber(qt_version, version_type): + version_list = qt_version.split('.') + return version_list[version_type.value] + def findMSBuild(): filename = 'MSBuild.exe' for root, _, files in os.walk(findVSLatestDir() + r'\\MSBuild'): @@ -137,7 +147,8 @@ def build(arch, toolset, sdk_version, config_str, project_path_under_current_pat configuration_type = 'StaticLibrary' - qtFolderDir = "msvc2019_64" + qt_minor_version = getQtVersionNumber(qtver, QtVerison.Minor) + qtFolderDir = 'msvc2017_64' if int(qt_minor_version) <= 14 else 'msvc2019_64' vs_env_vars = {} vs_env_vars.update(getVSEnv()) @@ -224,11 +235,15 @@ def parse_args(): '-t', '--toolset', default=win_toolset_default, type=str, help='Use specified platform toolset version') ap.add_argument( - '-q', '--qtver', default='5.15.0', + '-q', '--qtver', default=qt_version_default, help='Sets the version of Qmake') parsed_args = ap.parse_args() + if parsed_args.toolset: + if parsed_args.toolset[0] != 'v': + parsed_args.toolset = 'v' + parsed_args.toolset + return parsed_args diff --git a/update-translations.ps1 b/update-translations.ps1 index a67c5ba45c877c6c064e7a679410530094d305a2..02459d4f535f5b8157f0eb2a4ff83eca1cc3052c 100644 --- a/update-translations.ps1 +++ b/update-translations.ps1 @@ -5,7 +5,8 @@ param ( $clientDir = split-path -parent $MyInvocation.MyCommand.Definition $qtver = If ($qtver) { $qtver } Else { "5.15.0" } -$qtMsvcDir = "msvc2019_64" +$qtMinorVer = $qtver.split('.')[1] +$qtMsvcDir = If (([int]$qtMinorVer) -le 14) {"msvc2017_64"} Else {"msvc2019_64"} $QtDir = "C:\Qt\$qtver\$qtMsvcDir" $tsFileNames = Get-ChildItem -Path "$clientDir\translations" -Recurse -Include *.ts