diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-29 07:35:34 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-09-29 07:35:34 +0200 |
commit | 3bbcb7b0e6e0342569aa155d695bca46a7459eb0 (patch) | |
tree | e3675d77f409db4ecbc4f92cdfdbfa62763cb2d4 /build_scripts | |
parent | 9881b68c4c7bc1715cd266c41c63a3a918d83b07 (diff) | |
parent | 50247e7d4a67e892a85dff7472f889bac97c91c7 (diff) |
Merge remote-tracking branch 'origin/5.15' into dev
Change-Id: Ie6da3938b82f5ebe96dd12bd65a3ccc4180d2fba
Diffstat (limited to 'build_scripts')
-rw-r--r-- | build_scripts/utils.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/build_scripts/utils.py b/build_scripts/utils.py index 2ed0e2a2c..ad17a7ba8 100644 --- a/build_scripts/utils.py +++ b/build_scripts/utils.py @@ -1080,13 +1080,23 @@ def get_qtci_virtualEnv(python_ver, host, hostArch, targetArch): _pExe = "python.exe" # With windows we are creating building 32-bit target in 64-bit host if hostArch == "X86_64" and targetArch == "X86": - if python_ver == "3": - _pExe = os.path.join(os.getenv("PYTHON3_32_PATH"), "python.exe") + if python_ver.startswith("3"): + print("Try to find python from {} env variable".format("PYTHON"+python_ver+"-32_PATH")) + _path = os.getenv("PYTHON"+python_ver+"-32_PATH", "") + _pExe = os.path.join(_path, "python.exe") + if not os.path.isfile(_pExe): + print("Can't find python.exe from {}, using default python3".format(_pExe)) + _pExe = os.path.join(os.getenv("PYTHON3_32_PATH"), "python.exe") else: - _pExe = os.path.join(os.getenv("PYTHON2_32_PATH"), "python.exe") + _pExe = os.path.join(os.getenv("PYTHON2_32_PATH"), "python.exe") else: - if python_ver == "3": - _pExe = os.path.join(os.getenv("PYTHON3_PATH"), "python.exe") + if python_ver.startswith("3"): + print("Try to find python from {} env variable".format("PYTHON"+python_ver+"-64_PATH")) + _path = os.getenv("PYTHON"+python_ver+"-64_PATH", "") + _pExe = os.path.join(_path, "python.exe") + if not os.path.isfile(_pExe): + print("Can't find python.exe from {}, using default python3".format(_pExe)) + _pExe = os.path.join(os.getenv("PYTHON3_PATH"), "python.exe") env_python = _env + "\\Scripts\\python.exe" env_pip = _env + "\\Scripts\\pip.exe" else: |