diff options
author | Eike Ziller <eike.ziller@qt.io> | 2020-07-14 16:58:24 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2020-07-17 06:23:03 +0000 |
commit | ded5c64d5391185214f45f01e6661dff6cffdea5 (patch) | |
tree | c35ee2d071722e4cc695fe1d4ff9be0a5bc4a5be /scripts/deployqt.py | |
parent | cc7caee1339f94795b3d7057d6d1336a51572e86 (diff) | |
download | qt-creator-ded5c64d5391185214f45f01e6661dff6cffdea5.tar.gz |
Fix deployment of clazy-standalone
On Linux and macOS, clazy-standalone links against some dynamic
libraries which we need to ship.
Fixes: QTCREATORBUG-24344
Change-Id: I4946d2ae22fc9363445e6a3eecb8d9e40be5ef0e
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'scripts/deployqt.py')
-rwxr-xr-x | scripts/deployqt.py | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/scripts/deployqt.py b/scripts/deployqt.py index 5d7011e068..851a642633 100755 --- a/scripts/deployqt.py +++ b/scripts/deployqt.py @@ -253,25 +253,29 @@ def deploy_libclang(install_dir, llvm_install_dir, chrpath_bin): clangbindirtarget)) resourcetarget = os.path.join(clanglibdirtarget, 'clang') else: + # libclang -> Qt Creator libraries libsources = glob(os.path.join(llvm_install_dir, 'lib', 'libclang.so*')) for libsource in libsources: deployinfo.append((libsource, os.path.join(install_dir, 'lib', 'qtcreator'))) - clangbinary = os.path.join(llvm_install_dir, 'bin', 'clang') - clangdbinary = os.path.join(llvm_install_dir, 'bin', 'clangd') - clangtidybinary = os.path.join(llvm_install_dir, 'bin', 'clang-tidy') - clazybinary = os.path.join(llvm_install_dir, 'bin', 'clazy-standalone') + # clang binaries -> clang libexec clangbinary_targetdir = os.path.join(install_dir, 'libexec', 'qtcreator', 'clang', 'bin') if not os.path.exists(clangbinary_targetdir): os.makedirs(clangbinary_targetdir) - deployinfo.append((clangbinary, clangbinary_targetdir)) - deployinfo.append((clangdbinary, clangbinary_targetdir)) - deployinfo.append((clangtidybinary, clangbinary_targetdir)) - deployinfo.append((clazybinary, clangbinary_targetdir)) - # copy link target if clang is actually a symlink - if os.path.islink(clangbinary): - linktarget = os.readlink(clangbinary) - deployinfo.append((os.path.join(os.path.dirname(clangbinary), linktarget), - os.path.join(clangbinary_targetdir, linktarget))) + for binary in ['clang', 'clangd', 'clang-tidy', 'clazy-standalone']: + binary_filepath = os.path.join(llvm_install_dir, 'bin', binary) + deployinfo.append((binary_filepath, clangbinary_targetdir)) + # add link target if binary is actually a symlink (to a binary in the same directory) + if os.path.islink(binary_filepath): + linktarget = os.readlink(binary_filepath) + deployinfo.append((os.path.join(os.path.dirname(binary_filepath), linktarget), + os.path.join(clangbinary_targetdir, linktarget))) + clanglibs_targetdir = os.path.join(install_dir, 'libexec', 'qtcreator', 'clang', 'lib') + # support libraries (for clazy) -> clang libexec + if not os.path.exists(clanglibs_targetdir): + os.makedirs(clanglibs_targetdir) + for lib_pattern in ['ClazyPlugin.so', 'libclang-cpp.so*']: + for lib in glob(os.path.join(llvm_install_dir, 'lib', lib_pattern)): + deployinfo.append((lib, clanglibs_targetdir)) resourcetarget = os.path.join(install_dir, 'libexec', 'qtcreator', 'clang', 'lib', 'clang') print("copying libclang...") @@ -281,10 +285,15 @@ def deploy_libclang(install_dir, llvm_install_dir, chrpath_bin): if common.is_linux_platform(): # libclang was statically compiled, so there is no need for the RPATHs - # and they are confusing when fixing RPATHs later in the process - print("removing libclang RPATHs...") + # and they are confusing when fixing RPATHs later in the process. + # Also fix clazy-standalone RPATH. + print("fixing Clang RPATHs...") for source, target in deployinfo: - if not os.path.islink(target): + filename = os.path.basename(source) + targetfilepath = target if not os.path.isdir(target) else os.path.join(target, filename) + if filename == 'clazy-standalone': + subprocess.check_call([chrpath_bin, '-r', '$ORIGIN/../lib', targetfilepath]) + elif not os.path.islink(target): targetfilepath = target if not os.path.isdir(target) else os.path.join(target, os.path.basename(source)) subprocess.check_call([chrpath_bin, '-d', targetfilepath]) |