scripts: Deploy clang-format tool

The beautifier plugin can use the clang-format tool, which is statically
build, and it's around 2-6 MB in size.

Fixes: QTCREATORBUG-25600
Change-Id: I900f0dbfc2ba2773d3ad986c149adb41a4103e94
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Cristian Adam
2022-06-27 15:26:03 +02:00
parent 2e85c48944
commit 22b8f3bdcd
2 changed files with 4 additions and 2 deletions

View File

@ -238,7 +238,7 @@ def deploy_clang(install_dir, llvm_install_dir, chrpath_bin):
clanglibdirtarget = os.path.join(install_dir, 'bin', 'clang', 'lib')
if not os.path.exists(clanglibdirtarget):
os.makedirs(clanglibdirtarget)
for binary in ['clangd', 'clang-tidy', 'clazy-standalone']:
for binary in ['clangd', 'clang-tidy', 'clazy-standalone', 'clang-format']:
binary_filepath = os.path.join(llvm_install_dir, 'bin', binary + '.exe')
if os.path.exists(binary_filepath):
deployinfo.append((binary_filepath, clangbindirtarget))
@ -248,7 +248,7 @@ def deploy_clang(install_dir, llvm_install_dir, chrpath_bin):
clangbinary_targetdir = os.path.join(install_dir, 'libexec', 'qtcreator', 'clang', 'bin')
if not os.path.exists(clangbinary_targetdir):
os.makedirs(clangbinary_targetdir)
for binary in ['clangd', 'clang-tidy', 'clazy-standalone']:
for binary in ['clangd', 'clang-tidy', 'clazy-standalone', 'clang-format']:
binary_filepath = os.path.join(llvm_install_dir, 'bin', binary)
if os.path.exists(binary_filepath):
deployinfo.append((binary_filepath, clangbinary_targetdir))

View File

@ -123,6 +123,8 @@ if [ $LLVM_INSTALL_DIR ]; then
cp -Rf "$clangdsource" "$libexec_path/clang/bin/" || exit 1
clangtidysource="$LLVM_INSTALL_DIR"/bin/clang-tidy
cp -Rf "$clangtidysource" "$libexec_path/clang/bin/" || exit 1
clangformatsource="$LLVM_INSTALL_DIR"/bin/clang-format
cp -Rf "$clangformatsource" "$libexec_path/clang/bin/" || exit 1
clazysource="$LLVM_INSTALL_DIR"/bin/clazy-standalone
cp -Rf "$clazysource" "$libexec_path/clang/bin/" || exit 1
install_name_tool -add_rpath "@executable_path/../lib" "$libexec_path/clang/bin/clazy-standalone" 2> /dev/null