mirror of
https://github.com/savoirfairelinux/jami-client-qt.git
synced 2025-12-18 00:36:35 +08:00
misc: better parameterization for Qt version and toolset version
Change-Id: Ic8aad234c8806bd38a1b1633957503b09a01c137
This commit is contained in:
@@ -19,13 +19,14 @@ If (test-path $stampFile) {
|
|||||||
|
|
||||||
# default values
|
# default values
|
||||||
$qtver = If ($qtver) { $qtver } Else { "5.15.0" }
|
$qtver = If ($qtver) { $qtver } Else { "5.15.0" }
|
||||||
|
$qtMinorVer = $qtver.split('.')[1]
|
||||||
$mode = If ($mode) { $mode } Else { "Release" }
|
$mode = If ($mode) { $mode } Else { "Release" }
|
||||||
|
|
||||||
if (!$outDir) { $outDir = $clientDir + "\x64\" + $mode }
|
if (!$outDir) { $outDir = $clientDir + "\x64\" + $mode }
|
||||||
If (!(test-path $outDir)) { New-Item -ItemType directory -Path $outDir -Force }
|
If (!(test-path $outDir)) { New-Item -ItemType directory -Path $outDir -Force }
|
||||||
|
|
||||||
$qtverSplit1, $qtverSplit2 , $qtverSplit3 = $qtver.Split('.')
|
$qtverSplit1, $qtverSplit2 , $qtverSplit3 = $qtver.Split('.')
|
||||||
$qtMsvcDir = "msvc2019_64"
|
$qtMsvcDir = If (([int]$qtMinorVer) -le 14) {"msvc2017_64"} Else {"msvc2019_64"}
|
||||||
|
|
||||||
$QtDir = "C:\Qt\$qtver\$qtMsvcDir"
|
$QtDir = "C:\Qt\$qtver\$qtMsvcDir"
|
||||||
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ win32-msvc {
|
|||||||
|
|
||||||
CONFIG += suppress_vcproj_warnings c++17 qtquickcompiler
|
CONFIG += suppress_vcproj_warnings c++17 qtquickcompiler
|
||||||
|
|
||||||
QTQUICK_COMPILER_SKIPPED_RESOURCES += ./resources.qrc
|
QTQUICK_COMPILER_SKIPPED_RESOURCES += resources.qrc
|
||||||
|
|
||||||
# compiler options
|
# compiler options
|
||||||
QMAKE_CXXFLAGS += /wd"4068" /wd"4099" /wd"4189" /wd"4267" /wd"4577" /wd"4467" /wd"4715" /wd"4828"
|
QMAKE_CXXFLAGS += /wd"4068" /wd"4099" /wd"4189" /wd"4267" /wd"4577" /wd"4467" /wd"4715" /wd"4828"
|
||||||
|
|||||||
@@ -8,10 +8,12 @@ import argparse
|
|||||||
import multiprocessing
|
import multiprocessing
|
||||||
import fileinput
|
import fileinput
|
||||||
import re
|
import re
|
||||||
|
from enum import Enum
|
||||||
|
|
||||||
# vs help
|
# vs help
|
||||||
win_sdk_default = '10.0.16299.0'
|
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(
|
vs_where_path = os.path.join(
|
||||||
os.environ['ProgramFiles(x86)'], 'Microsoft Visual Studio', 'Installer', 'vswhere.exe'
|
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')]
|
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={}):
|
def execute_cmd(cmd, with_shell=False, env_vars={}):
|
||||||
if(bool(env_vars)):
|
if(bool(env_vars)):
|
||||||
@@ -62,6 +68,10 @@ def findVSLatestDir():
|
|||||||
return
|
return
|
||||||
|
|
||||||
|
|
||||||
|
def getQtVersionNumber(qt_version, version_type):
|
||||||
|
version_list = qt_version.split('.')
|
||||||
|
return version_list[version_type.value]
|
||||||
|
|
||||||
def findMSBuild():
|
def findMSBuild():
|
||||||
filename = 'MSBuild.exe'
|
filename = 'MSBuild.exe'
|
||||||
for root, _, files in os.walk(findVSLatestDir() + r'\\MSBuild'):
|
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'
|
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 = {}
|
||||||
vs_env_vars.update(getVSEnv())
|
vs_env_vars.update(getVSEnv())
|
||||||
@@ -224,11 +235,15 @@ def parse_args():
|
|||||||
'-t', '--toolset', default=win_toolset_default, type=str,
|
'-t', '--toolset', default=win_toolset_default, type=str,
|
||||||
help='Use specified platform toolset version')
|
help='Use specified platform toolset version')
|
||||||
ap.add_argument(
|
ap.add_argument(
|
||||||
'-q', '--qtver', default='5.15.0',
|
'-q', '--qtver', default=qt_version_default,
|
||||||
help='Sets the version of Qmake')
|
help='Sets the version of Qmake')
|
||||||
|
|
||||||
parsed_args = ap.parse_args()
|
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
|
return parsed_args
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,8 @@ param (
|
|||||||
|
|
||||||
$clientDir = split-path -parent $MyInvocation.MyCommand.Definition
|
$clientDir = split-path -parent $MyInvocation.MyCommand.Definition
|
||||||
$qtver = If ($qtver) { $qtver } Else { "5.15.0" }
|
$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"
|
$QtDir = "C:\Qt\$qtver\$qtMsvcDir"
|
||||||
|
|
||||||
$tsFileNames = Get-ChildItem -Path "$clientDir\translations" -Recurse -Include *.ts
|
$tsFileNames = Get-ChildItem -Path "$clientDir\translations" -Recurse -Include *.ts
|
||||||
|
|||||||
Reference in New Issue
Block a user