aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts
diff options
context:
space:
mode:
authorCristián Maureira-Fredes <cristian.maureira-fredes@qt.io>2020-02-17 13:41:08 +0100
committerCristián Maureira-Fredes <cristian.maureira-fredes@qt.io>2020-02-18 17:33:19 +0100
commit22e359bc19daf19033332aa2d7bb9726c7f4be14 (patch)
tree5d3697de57795276efd3529ff9bcb2c8109bbbb3 /build_scripts
parent93daae0beea09c8d745d691889838ed816c23eba (diff)
shiboken: Improve the libdir for windows
With virtualenv 20 we have the case where the first path in the PYTHON_LIBRARIES cmake variable was wrong: a_virtual_env/libs/python3.lib so the python code inside the helper didn't have a proper check if the file was valid or it was just a wrong construct. Additionally, the 'prefix' variable will contain the virtual environment directory location, which will not contain the 'libs' directory, because that's included in the system's installation path. To solve this, we use the 'INCLUDEPY' directory, which is correct as a base to create the real 'libs' one. Task-number: PYSIDE-1231 Change-Id: Ifca08d74c49cd57572836a087edb96c089266dc7 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'build_scripts')
-rw-r--r--build_scripts/main.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py
index 674048e23..cf56850df 100644
--- a/build_scripts/main.py
+++ b/build_scripts/main.py
@@ -530,7 +530,13 @@ class PysideBuild(_build):
self.py_scripts_dir = py_scripts_dir
if py_libdir is None or not os.path.exists(py_libdir):
if sys.platform == "win32":
- py_libdir = os.path.join(py_prefix, "libs")
+ # For virtual environments on Windows, the py_prefix will contain a path pointing
+ # to it, instead of the system Python installation path.
+ # Since INCLUDEPY contains a path to the system location, we use the same base
+ # directory to define the py_libdir variable.
+ py_libdir = os.path.join(os.path.dirname(py_include_dir), "libs")
+ if not os.path.isdir(py_libdir):
+ raise DistutilsSetupError("Failed to locate the 'libs' directory")
else:
py_libdir = os.path.join(py_prefix, "lib")
if py_include_dir is None or not os.path.exists(py_include_dir):