aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-08-29 10:33:56 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-08-29 10:34:09 +0200
commit7eb87edb6c951a9bbf8a850e3de13466229df853 (patch)
tree622693dd646a40b73532f43f983b168db65ee125 /build_scripts
parentfbddb1a61600a1a33a1d3088ec47743164038e85 (diff)
parentef2c47069c545f5afdf767c70add543bac4c77e6 (diff)
Merge remote-tracking branch 'origin/5.11' into dev
Diffstat (limited to 'build_scripts')
-rw-r--r--build_scripts/main.py17
1 files changed, 15 insertions, 2 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py
index d825357fd..b64d6f1a9 100644
--- a/build_scripts/main.py
+++ b/build_scripts/main.py
@@ -1207,6 +1207,7 @@ class PysideBuild(_build):
raise RuntimeError("Could not find the location of the libclang "
"library inside the CMake cache file.")
+ target_name = None
if is_win:
# clang_lib_path points to the static import library
# (lib/libclang.lib), whereas we want to copy the shared
@@ -1214,10 +1215,21 @@ class PysideBuild(_build):
clang_lib_path = re.sub(r'lib/libclang.lib$', 'bin/libclang.dll',
clang_lib_path)
else:
+ if sys.platform != 'darwin' and os.path.islink(clang_lib_path):
+ # On Linux, we get "libclang.so" from CMake which is
+ # a symlink:
+ # libclang.so -> libclang.so.6 -> libclang.so.6.0.
+ # shiboken2 links against libclang.so.6. So, we
+ # determine the target name by resolving just
+ # one symlink (note: os.path.realpath() resolves all).
+ target_name = os.readlink(clang_lib_path)
# We want to resolve any symlink on Linux and macOS, and
# copy the actual file.
clang_lib_path = os.path.realpath(clang_lib_path)
+ if not target_name:
+ target_name = os.path.basename(clang_lib_path)
+
# Path to directory containing libclang.
clang_lib_dir = os.path.dirname(clang_lib_path)
@@ -1226,9 +1238,10 @@ class PysideBuild(_build):
destination_dir = "{}/PySide2".format(os.path.join(self.script_dir,
'pyside_package'))
if os.path.exists(clang_lib_path):
- log.info('Copying libclang shared library to the package folder.')
+ log.info('Copying libclang shared library {} to the package folder as {}.'.format(
+ clang_lib_path, target_name))
basename = os.path.basename(clang_lib_path)
- destination_path = os.path.join(destination_dir, basename)
+ destination_path = os.path.join(destination_dir, target_name)
# Need to modify permissions in case file is not writable
# (a reinstall would cause a permission denied error).