aboutsummaryrefslogtreecommitdiffstats
path: root/build_scripts
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2018-05-07 15:00:52 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2018-05-08 08:27:55 +0000
commit31e38f359e92291aa009aa91fb292928dc31b341 (patch)
tree5d71220dc3a8bb87af3f0ebd1c5460fc90287f5e /build_scripts
parent7fd609e76fd9eef35b0d1f208ea2bf36ad4fc691 (diff)
Fix copying of libclang for standalone builds
Instead of copying a multitude of symlinks, resolve the path and copy just the libclang library which CMake detected, and thus linked against for the shiboken executable. Change-Id: I02887eb4027d29255a32127fb39aff7a1d127f57 Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'build_scripts')
-rw-r--r--build_scripts/main.py24
1 files changed, 9 insertions, 15 deletions
diff --git a/build_scripts/main.py b/build_scripts/main.py
index 3fe59e065..a98a254e0 100644
--- a/build_scripts/main.py
+++ b/build_scripts/main.py
@@ -1197,27 +1197,21 @@ class pyside_build(_build):
# library (bin/libclang.dll).
clang_lib_path = re.sub(r'lib/libclang.lib$', 'bin/libclang.dll',
clang_lib_path)
+ else:
+ # We want to resolve any symlink on Linux and macOS, and
+ # copy the actual file.
+ clang_lib_path = os.path.realpath(clang_lib_path)
- # Path to directory containing clang.
+ # Path to directory containing libclang.
clang_lib_dir = os.path.dirname(clang_lib_path)
- # The name of the clang file found by CMake.
- basename = os.path.basename(clang_lib_path)
-
- # We want to copy the library and all the symlinks for now,
- # thus the wildcard.
- clang_filter = basename + "*"
-
- # Destination is the package folder near the other extension
- # modules.
+ # The destination will be the package folder near the other
+ # extension modules.
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 pyside package.')
-
- copydir(clang_lib_dir, destination_dir,
- filter=[clang_filter],
- recursive=False)
+ log.info('Copying libclang shared library to the package folder.')
+ copyfile(clang_lib_path, destination_dir)
else:
raise RuntimeError("Error copying libclang library "
"from {} to {}. ".format(