diff options
author | Eike Ziller <eike.ziller@qt.io> | 2020-12-09 14:12:20 +0100 |
---|---|---|
committer | Cristian Adam <cristian.adam@qt.io> | 2020-12-09 13:35:38 +0000 |
commit | ca016bfb2e7a78253b1ad5dfc457583e8491be1a (patch) | |
tree | ba11d5b05437836ce080724a2b1ef9d23101f255 /scripts/deployqt.py | |
parent | 3b7aee724d947df44361ed20e6479e3d7624ba65 (diff) | |
download | qt-creator-ca016bfb2e7a78253b1ad5dfc457583e8491be1a.tar.gz |
deploy.py: Support Python 2.7, do not require all clang executables
FileNotFoundException is new in Python 3.
We might not have a LLVM build with e.g. clazy-standalone and clang-tidy,
make deployment of Clang executables optional.
Change-Id: Id25b2f65a8d060bac9cb7a66fb2cd7022e2724e0
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Diffstat (limited to 'scripts/deployqt.py')
-rwxr-xr-x | scripts/deployqt.py | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/scripts/deployqt.py b/scripts/deployqt.py index 45bacd674e..4dc11b6cf5 100755 --- a/scripts/deployqt.py +++ b/scripts/deployqt.py @@ -113,7 +113,7 @@ def is_debug(fpath): try: output = subprocess.check_output(['dumpbin', '/imports', fpath]) return coredebug.search(output.decode(encoding)) != None - except FileNotFoundError: + except OSError: # dumpbin is not there, maybe MinGW ? Just ship all .dlls. return debug_build @@ -238,16 +238,10 @@ def deploy_libclang(install_dir, llvm_install_dir, chrpath_bin): os.makedirs(clanglibdirtarget) deployinfo.append((os.path.join(llvm_install_dir, 'bin', 'libclang.dll'), os.path.join(install_dir, 'bin'))) - deployinfo.append((os.path.join(llvm_install_dir, 'bin', 'clang.exe'), - clangbindirtarget)) - deployinfo.append((os.path.join(llvm_install_dir, 'bin', 'clang-cl.exe'), - clangbindirtarget)) - deployinfo.append((os.path.join(llvm_install_dir, 'bin', 'clangd.exe'), - clangbindirtarget)) - deployinfo.append((os.path.join(llvm_install_dir, 'bin', 'clang-tidy.exe'), - clangbindirtarget)) - deployinfo.append((os.path.join(llvm_install_dir, 'bin', 'clazy-standalone.exe'), - clangbindirtarget)) + for binary in ['clang', 'clang-cl', 'clangd', 'clang-tidy', 'clazy-standalone']: + binary_filepath = os.path.join(llvm_install_dir, 'bin', 'clang.exe') + if os.path.exists(binary_filepath): + deployinfo.append((binary_filepath, clangbindirtarget)) resourcetarget = os.path.join(clanglibdirtarget, 'clang') else: # libclang -> Qt Creator libraries @@ -260,12 +254,13 @@ def deploy_libclang(install_dir, llvm_install_dir, chrpath_bin): os.makedirs(clangbinary_targetdir) 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))) + if os.path.exists(binary_filepath): + 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): |