Skip to content
Snippets Groups Projects
Commit 512168c4 authored by Andreas Traczyk's avatar Andreas Traczyk
Browse files

misc: expose vs env vars to qmake command execution on windows

This patch prevents client build failure on systems without the
specific build toolchain path in the system or user path environment
variable.

It so happens that qmake needs the paths for the ms build toolchain,
so we pass them to the executing subprocess.

Gitlab: #581
Change-Id: Id5dcaead487d0c128c9fb04ca22d79438531b0c0
parent 6607e0e9
No related branches found
No related tags found
No related merge requests found
...@@ -137,28 +137,28 @@ def build(arch, toolset, sdk_version, config_str, project_path_under_current_pat ...@@ -137,28 +137,28 @@ def build(arch, toolset, sdk_version, config_str, project_path_under_current_pat
configuration_type = 'StaticLibrary' configuration_type = 'StaticLibrary'
qtFolderDir = "msvc2017_64" qtFolderDir = "msvc2019_64"
qtverSplit = qtver.split('.')
if((int(qtverSplit[0]) >= 6) or ((int(qtverSplit[0]) == 5) and (int(qtverSplit[1]) >= 15))): vs_env_vars = {}
qtFolderDir = "msvc2019_64" vs_env_vars.update(getVSEnv())
qmake_cmd = "C:\\Qt\\" + qtver + "\\" + qtFolderDir + "\\bin\\qmake.exe"
if (config_str == 'Release'): if (config_str == 'Release'):
print('Generating project using qmake ' + config_str + '|' + arch) print('Generating project using qmake ' + config_str + '|' + arch)
if(execute_cmd("C:\\Qt\\" + qtver + "\\" + qtFolderDir + "\\bin\\qmake.exe " + "-tp vc jami-qt.pro -o jami-qt.vcxproj")): if(execute_cmd(qmake_cmd + " -tp vc jami-qt.pro -o jami-qt.vcxproj", False, vs_env_vars)):
print("Qmake vcxproj file generate error") print("Qmake vcxproj file generate error")
sys.exit(1) sys.exit(1)
configuration_type = 'Application' configuration_type = 'Application'
elif (config_str == 'Beta'): elif (config_str == 'Beta'):
print('Generating project using qmake ' + config_str + '|' + arch) print('Generating project using qmake ' + config_str + '|' + arch)
if(execute_cmd("C:\\Qt\\" + qtver + "\\" + qtFolderDir + "\\bin\\qmake.exe " + "-tp vc jami-qt.pro -o jami-qt.vcxproj CONFIG+=Beta")): if(execute_cmd(qmake_cmd + " -tp vc jami-qt.pro -o jami-qt.vcxproj CONFIG+=Beta", False, vs_env_vars)):
print("Beat: Qmake vcxproj file generate error") print("Beta: Qmake vcxproj file generate error")
sys.exit(1) sys.exit(1)
config_str = 'Release' config_str = 'Release'
configuration_type = 'Application' configuration_type = 'Application'
elif (config_str == 'ReleaseCompile'): elif (config_str == 'ReleaseCompile'):
print('Generating project using qmake ' + config_str + '|' + arch) print('Generating project using qmake ' + config_str + '|' + arch)
if(execute_cmd("C:\\Qt\\" + qtver + "\\" + qtFolderDir + "\\bin\\qmake.exe " + "-tp vc jami-qt.pro -o jami-qt.vcxproj CONFIG+=ReleaseCompile")): if(execute_cmd(qmake_cmd + " -tp vc jami-qt.pro -o jami-qt.vcxproj CONFIG+=ReleaseCompile", False, vs_env_vars)):
print("ReleaseCompile: Qmake vcxproj file generate error") print("ReleaseCompile: Qmake vcxproj file generate error")
sys.exit(1) sys.exit(1)
config_str = 'Release' config_str = 'Release'
...@@ -167,8 +167,6 @@ def build(arch, toolset, sdk_version, config_str, project_path_under_current_pat ...@@ -167,8 +167,6 @@ def build(arch, toolset, sdk_version, config_str, project_path_under_current_pat
# but will be outputted into x64/Beta folder (for Beta Only) # but will be outputted into x64/Beta folder (for Beta Only)
print('Building projects in ' + config_str + '|' + arch) print('Building projects in ' + config_str + '|' + arch)
vs_env_vars = {}
vs_env_vars.update(getVSEnv())
this_dir = os.path.dirname(os.path.realpath(__file__)) this_dir = os.path.dirname(os.path.realpath(__file__))
qt_client_proj_path = this_dir + project_path_under_current_path qt_client_proj_path = this_dir + project_path_under_current_path
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment