diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/build.py | 78 | ||||
-rwxr-xr-x | scripts/build_plugin.py | 14 | ||||
-rw-r--r-- | scripts/common.py | 8 | ||||
-rwxr-xr-x | scripts/deployqt.py | 176 | ||||
-rwxr-xr-x | scripts/deployqtHelper_mac.sh | 3 | ||||
-rwxr-xr-x | scripts/shiboken2tasks.py | 52 |
6 files changed, 238 insertions, 93 deletions
diff --git a/scripts/build.py b/scripts/build.py index e7e414f508..6fd8d976b2 100755 --- a/scripts/build.py +++ b/scripts/build.py @@ -83,32 +83,44 @@ def get_arguments(): action='store_true', default=(not common.is_windows_platform())) parser.add_argument('--no-docs', help='Skip documentation generation', action='store_true', default=False) + parser.add_argument('--no-build-date', help='Does not show build date in about dialog, for reproducible builds', + action='store_true', default=False) parser.add_argument('--no-dmg', help='Skip disk image creation (macOS)', action='store_true', default=False) parser.add_argument('--no-zip', help='Skip creation of 7zip files for install and developer package', action='store_true', default=False) + parser.add_argument('--with-tests', help='Enable building of tests', + action='store_true', default=False) parser.add_argument('--add-make-arg', help='Passes the argument to the make tool.', action='append', dest='make_args', default=[]) + parser.add_argument('--add-config', help=('Adds the argument to the CMake configuration call. ' + 'Use "--add-config=-DSOMEVAR=SOMEVALUE" if the argument begins with a dash.'), + action='append', dest='config_args', default=[]) + parser.add_argument('--zip-infix', help='Adds an infix to generated zip files, use e.g. for a build number.', + default='') return parser.parse_args() def build_qtcreator(args, paths): if not os.path.exists(paths.build): os.makedirs(paths.build) prefix_paths = [paths.qt] - if args.llvm_path: - prefix_paths += [args.llvm_path] - if args.elfutils_path: - prefix_paths += [args.elfutils_path] + if paths.llvm: + prefix_paths += [paths.llvm] + if paths.elfutils: + prefix_paths += [paths.elfutils] build_type = 'Debug' if args.debug else 'Release' with_docs_str = 'OFF' if args.no_docs else 'ON' + build_date_option = 'OFF' if args.no_build_date else 'ON' + test_option = 'ON' if args.with_tests else 'OFF' cmake_args = ['cmake', '-DCMAKE_PREFIX_PATH=' + ';'.join(prefix_paths), '-DCMAKE_BUILD_TYPE=' + build_type, + '-DSHOW_BUILD_DATE=' + build_date_option, '-DWITH_DOCS=' + with_docs_str, '-DBUILD_DEVELOPER_DOCS=' + with_docs_str, '-DBUILD_EXECUTABLE_SDKTOOL=OFF', '-DCMAKE_INSTALL_PREFIX=' + paths.install, - '-DWITH_TESTS=OFF', + '-DWITH_TESTS=' + test_option, '-G', 'Ninja'] if args.python3: @@ -118,9 +130,10 @@ def build_qtcreator(args, paths): # even if MSVC is first mentioned in the PATH... # TODO would be nicer if we only did this if cl.exe is indeed first in the PATH if common.is_windows_platform(): - cmake_args += ['-DCMAKE_C_COMPILER=cl', - '-DCMAKE_CXX_COMPILER=cl', - '-DBUILD_EXECUTABLE_WIN32INTERRUPT=OFF', + if not os.environ.get('CC') and not os.environ.get('CXX'): + cmake_args += ['-DCMAKE_C_COMPILER=cl', + '-DCMAKE_CXX_COMPILER=cl'] + cmake_args += ['-DBUILD_EXECUTABLE_WIN32INTERRUPT=OFF', '-DBUILD_EXECUTABLE_WIN64INTERRUPT=OFF', '-DBUILD_LIBRARY_QTCREATORCDBEXT=OFF'] if args.python_path: @@ -138,6 +151,8 @@ def build_qtcreator(args, paths): '-DIDE_REVISION_STR=' + ide_revision, '-DIDE_REVISION_URL=https://code.qt.io/cgit/qt-creator/qt-creator.git/log/?id=' + ide_revision] + cmake_args += args.config_args + common.check_print_call(cmake_args + [paths.src], paths.build) build_args = ['cmake', '--build', '.'] if args.make_args: @@ -153,17 +168,12 @@ def build_qtcreator(args, paths): paths.build) if not args.no_docs: common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install, - '--component', 'qtc_docs_qtcreator'], - paths.build) - common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install, - '--component', 'html_docs_qtcreator'], + '--component', 'qch_docs'], paths.build) common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install, - '--component', 'html_docs_qtcreator-dev'], - paths.build) - common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install, - '--component', 'html_docs_qtcreator-dev'], + '--component', 'html_docs'], paths.build) + def build_wininterrupt(args, paths): if not common.is_windows_platform(): return @@ -201,29 +211,42 @@ def deploy_qt(args, paths): qt_plugins = os.path.join(paths.qt, 'plugins') qt_imports = os.path.join(paths.qt, 'imports') qt_qml = os.path.join(paths.qt, 'qml') + env = dict(os.environ) + if paths.llvm: + env['LLVM_INSTALL_DIR'] = paths.llvm common.check_print_call([script, app, qt_bins, qt_translations, qt_plugins, qt_imports, qt_qml], - paths.build) + paths.build, + env=env) else: + cmd_args = ['python', '-u', os.path.join(paths.src, 'scripts', 'deployqt.py'), '-i'] + if paths.elfutils: + cmd_args.extend(['--elfutils-path', paths.elfutils]) + if paths.llvm: + cmd_args.extend(['--llvm-path', paths.llvm]) exe = os.path.join(paths.install, 'bin', args.app_target) - common.check_print_call(['python', '-u', os.path.join(paths.src, 'scripts', 'deployqt.py'), - '-i', exe, os.path.join(paths.qt, 'bin', 'qmake')], + common.check_print_call(cmd_args + [exe, os.path.join(paths.qt, 'bin', 'qmake')], paths.build) def package_qtcreator(args, paths): if not args.no_zip: - common.check_print_call(['7z', 'a', '-mmt2', os.path.join(paths.result, 'qtcreator.7z'), '*'], + common.check_print_call(['7z', 'a', '-mmt2', + os.path.join(paths.result, 'qtcreator' + args.zip_infix + '.7z'), + '*'], paths.install) common.check_print_call(['7z', 'a', '-mmt2', - os.path.join(paths.result, 'qtcreator_dev.7z'), '*'], + os.path.join(paths.result, 'qtcreator' + args.zip_infix + '_dev.7z'), + '*'], paths.dev_install) if common.is_windows_platform(): common.check_print_call(['7z', 'a', '-mmt2', - os.path.join(paths.result, 'wininterrupt.7z'), '*'], + os.path.join(paths.result, 'wininterrupt' + args.zip_infix + '.7z'), + '*'], paths.wininterrupt_install) if not args.no_cdb: common.check_print_call(['7z', 'a', '-mmt2', - os.path.join(paths.result, 'qtcreatorcdbext.7z'), '*'], + os.path.join(paths.result, 'qtcreatorcdbext' + args.zip_infix + '.7z'), + '*'], paths.qtcreatorcdbext_install) if common.is_mac_platform(): @@ -232,7 +255,7 @@ def package_qtcreator(args, paths): if not args.no_dmg: common.check_print_call(['python', '-u', os.path.join(paths.src, 'scripts', 'makedmg.py'), - 'qt-creator.dmg', + 'qt-creator' + args.zip_infix + '.dmg', 'Qt Creator', paths.src, paths.install], @@ -242,7 +265,8 @@ def get_paths(args): Paths = collections.namedtuple('Paths', ['qt', 'src', 'build', 'install', 'dev_install', 'wininterrupt_install', - 'qtcreatorcdbext_install', 'result']) + 'qtcreatorcdbext_install', 'result', + 'elfutils', 'llvm']) build_path = os.path.abspath(args.build) install_path = os.path.join(build_path, 'install') return Paths(qt=os.path.abspath(args.qt_path), @@ -252,7 +276,9 @@ def get_paths(args): dev_install=os.path.join(install_path, 'qt-creator-dev'), wininterrupt_install=os.path.join(install_path, 'wininterrupt'), qtcreatorcdbext_install=os.path.join(install_path, 'qtcreatorcdbext'), - result=build_path) + result=build_path, + elfutils=os.path.abspath(args.elfutils_path) if args.elfutils_path else None, + llvm=os.path.abspath(args.llvm_path) if args.llvm_path else None) def main(): args = get_arguments() diff --git a/scripts/build_plugin.py b/scripts/build_plugin.py index 97c4829745..9df8c64f74 100755 --- a/scripts/build_plugin.py +++ b/scripts/build_plugin.py @@ -51,6 +51,8 @@ def get_arguments(): parser.add_argument('--add-config', help=('Adds the argument to the CMake configuration call. ' 'Use "--add-config=-DSOMEVAR=SOMEVALUE" if the argument begins with a dash.'), action='append', dest='config_args', default=[]) + parser.add_argument('--with-docs', help='Build and install documentation.', + action='store_true', default=False) parser.add_argument('--deploy', help='Installs the "Dependencies" component of the plugin.', action='store_true', default=False) parser.add_argument('--debug', help='Enable debug builds', action='store_true', default=False) @@ -79,6 +81,9 @@ def build(args, paths): # TODO this works around a CMake bug https://gitlab.kitware.com/cmake/cmake/issues/20119 cmake_args += ['-DBUILD_WITH_PCH=OFF'] + if args.with_docs: + cmake_args += ['-DWITH_DOCS=ON'] + ide_revision = common.get_commit_SHA(paths.src) if ide_revision: cmake_args += ['-DQTC_PLUGIN_REVISION=' + ide_revision] @@ -88,8 +93,17 @@ def build(args, paths): cmake_args += args.config_args common.check_print_call(cmake_args + [paths.src], paths.build) common.check_print_call(['cmake', '--build', '.'], paths.build) + if args.with_docs: + common.check_print_call(['cmake', '--build', '.', '--target', 'docs'], paths.build) common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install, '--strip'], paths.build) + if args.with_docs: + common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install, + '--component', 'qch_docs'], + paths.build) + common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install, + '--component', 'html_docs'], + paths.build) if args.deploy: common.check_print_call(['cmake', '--install', '.', '--prefix', paths.install, '--component', 'Dependencies'], diff --git a/scripts/common.py b/scripts/common.py index 61923803fb..d033108648 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -40,18 +40,20 @@ def is_linux_platform(): def is_mac_platform(): return sys.platform.startswith('darwin') -def check_print_call(command, workdir): +def check_print_call(command, workdir, env=None): print('------------------------------------------') print('COMMAND:') print(' '.join(['"' + c.replace('"', '\\"') + '"' for c in command])) print('PWD: "' + workdir + '"') print('------------------------------------------') - subprocess.check_call(command, cwd=workdir) + subprocess.check_call(command, cwd=workdir, env=env) def get_git_SHA(path): try: - return subprocess.check_output(['git', 'rev-list', '-n1', 'HEAD'], cwd=path).strip() + output = subprocess.check_output(['git', 'rev-list', '-n1', 'HEAD'], cwd=path).strip() + decoded_output = output.decode(encoding) if encoding else output + return decoded_output except subprocess.CalledProcessError: return None return None diff --git a/scripts/deployqt.py b/scripts/deployqt.py index 5e4808a211..4aaea9b620 100755 --- a/scripts/deployqt.py +++ b/scripts/deployqt.py @@ -27,10 +27,10 @@ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ################################################################################ +import argparse import os import locale import sys -import getopt import subprocess import re import shutil @@ -38,10 +38,38 @@ from glob import glob import common -ignoreErrors = False debug_build = False encoding = locale.getdefaultlocale()[1] +def get_args(): + parser = argparse.ArgumentParser(description='Deploy Qt Creator dependencies for packaging') + parser.add_argument('-i', '--ignore-errors', help='For backward compatibility', + action='store_true', default=False) + parser.add_argument('--elfutils-path', + help='Path to elfutils installation for use by perfprofiler (Windows, Linux)') + # TODO remove defaulting to LLVM_INSTALL_DIR when we no longer build qmake based packages + parser.add_argument('--llvm-path', + help='Path to LLVM installation', + default=os.environ.get('LLVM_INSTALL_DIR')) + parser.add_argument('qtcreator_binary', help='Path to Qt Creator binary') + parser.add_argument('qmake_binary', help='Path to qmake binary') + + args = parser.parse_args() + + args.qtcreator_binary = os.path.abspath(args.qtcreator_binary) + if common.is_windows_platform() and not args.qtcreator_binary.lower().endswith(".exe"): + args.qtcreator_binary = args.qtcreator_binary + ".exe" + if not os.path.isfile(args.qtcreator_binary): + print('Cannot find Qt Creator binary.') + sys.exit(1) + + args.qmake_binary = which(args.qmake_binary) + if not args.qmake_binary: + print('Cannot find qmake binary.') + sys.exit(2) + + return args + def usage(): print("Usage: %s <existing_qtcreator_binary> [qmake_path]" % os.path.basename(sys.argv[0])) @@ -74,17 +102,12 @@ def is_debug(fpath): # bootstrap exception if coredebug.search(fpath): return True - output = subprocess.check_output(['dumpbin', '/imports', fpath]) - return coredebug.search(output.decode(encoding)) != None - -def op_failed(details = None): - if details != None: - print(details) - if ignoreErrors == False: - print("Error: operation failed!") - sys.exit(2) - else: - print("Error: operation failed, but proceeding gracefully.") + try: + output = subprocess.check_output(['dumpbin', '/imports', fpath]) + return coredebug.search(output.decode(encoding)) != None + except FileNotFoundError: + # dumpbin is not there, maybe MinGW ? Just ship all .dlls. + return debug_build def is_ignored_windows_file(use_debug, basepath, filename): ignore_patterns = ['.lib', '.pdb', '.exp', '.ilk'] @@ -132,7 +155,7 @@ def copy_qt_libs(target_qt_prefix_path, qt_bin_dir, qt_libs_dir, qt_plugin_dir, try: os.symlink(linkto, os.path.join(lib_dest, os.path.basename(library))) except OSError: - op_failed("Link already exists!") + pass else: shutil.copy(library, lib_dest) @@ -230,25 +253,30 @@ 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) + # on RHEL ClazyPlugin is in lib64 + for lib_pattern in ['lib64/ClazyPlugin.so', 'lib/ClazyPlugin.so', 'lib/libclang-cpp.so*']: + for lib in glob(os.path.join(llvm_install_dir, lib_pattern)): + deployinfo.append((lib, clanglibs_targetdir)) resourcetarget = os.path.join(install_dir, 'libexec', 'qtcreator', 'clang', 'lib', 'clang') print("copying libclang...") @@ -258,10 +286,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]) @@ -270,43 +303,56 @@ def deploy_libclang(install_dir, llvm_install_dir, chrpath_bin): shutil.rmtree(resourcetarget) common.copytree(resourcesource, resourcetarget, symlinks=True) +def deploy_elfutils(qtc_install_dir, chrpath_bin, args): + if common.is_mac_platform(): + return + + def lib_name(name, version): + return ('lib' + name + '.so.' + version if common.is_linux_platform() + else name + '.dll') + + version = '1' + libs = ['elf', 'dw'] + elfutils_lib_path = os.path.join(args.elfutils_path, 'lib') + if common.is_linux_platform(): + install_path = os.path.join(qtc_install_dir, 'lib', 'elfutils') + backends_install_path = install_path + elif common.is_windows_platform(): + install_path = os.path.join(qtc_install_dir, 'bin') + backends_install_path = os.path.join(qtc_install_dir, 'lib', 'elfutils') + libs.append('eu_compat') + if not os.path.exists(install_path): + os.makedirs(install_path) + if not os.path.exists(backends_install_path): + os.makedirs(backends_install_path) + # copy main libs + libs = [os.path.join(elfutils_lib_path, lib_name(lib, version)) for lib in libs] + for lib in libs: + print(lib, '->', install_path) + shutil.copy(lib, install_path) + # fix rpath + if common.is_linux_platform(): + relative_path = os.path.relpath(backends_install_path, install_path) + subprocess.check_call([chrpath_bin, '-r', os.path.join('$ORIGIN', relative_path), + os.path.join(install_path, lib_name('dw', version))]) + # copy backend files + # only non-versioned, we never dlopen the versioned ones + files = glob(os.path.join(elfutils_lib_path, 'elfutils', '*ebl_*.*')) + versioned_files = glob(os.path.join(elfutils_lib_path, 'elfutils', '*ebl_*.*-*.*.*')) + unversioned_files = [file for file in files if file not in versioned_files] + for file in unversioned_files: + print(file, '->', backends_install_path) + shutil.copy(file, backends_install_path) + def main(): - try: - opts, args = getopt.gnu_getopt(sys.argv[1:], 'hi', ['help', 'ignore-errors']) - except getopt.GetoptError: - usage() - sys.exit(2) - for o, _ in opts: - if o in ('-h', '--help'): - usage() - sys.exit(0) - if o in ('-i', '--ignore-errors'): - global ignoreErrors - ignoreErrors = True - print("Note: Ignoring all errors") - - qtcreator_binary = os.path.abspath(args[0]) - if common.is_windows_platform() and not qtcreator_binary.lower().endswith(".exe"): - qtcreator_binary = qtcreator_binary + ".exe" - - if len(args) < 1 or not os.path.isfile(qtcreator_binary): - usage() - sys.exit(2) + args = get_args() - qtcreator_binary_path = os.path.dirname(qtcreator_binary) + qtcreator_binary_path = os.path.dirname(args.qtcreator_binary) install_dir = os.path.abspath(os.path.join(qtcreator_binary_path, '..')) if common.is_linux_platform(): qt_deploy_prefix = os.path.join(install_dir, 'lib', 'Qt') else: qt_deploy_prefix = os.path.join(install_dir, 'bin') - qmake_bin = 'qmake' - if len(args) > 1: - qmake_bin = args[1] - qmake_bin = which(qmake_bin) - - if qmake_bin == None: - print("Cannot find required binary 'qmake'.") - sys.exit(2) chrpath_bin = None if common.is_linux_platform(): @@ -315,7 +361,7 @@ def main(): print("Cannot find required binary 'chrpath'.") sys.exit(2) - qt_install_info = common.get_qt_install_info(qmake_bin) + qt_install_info = common.get_qt_install_info(args.qmake_binary) QT_INSTALL_LIBS = qt_install_info['QT_INSTALL_LIBS'] QT_INSTALL_BINS = qt_install_info['QT_INSTALL_BINS'] QT_INSTALL_PLUGINS = qt_install_info['QT_INSTALL_PLUGINS'] @@ -334,16 +380,18 @@ def main(): if common.is_windows_platform(): global debug_build - debug_build = is_debug(qtcreator_binary) + debug_build = is_debug(args.qtcreator_binary) if common.is_windows_platform(): copy_qt_libs(qt_deploy_prefix, QT_INSTALL_BINS, QT_INSTALL_BINS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) else: copy_qt_libs(qt_deploy_prefix, QT_INSTALL_BINS, QT_INSTALL_LIBS, QT_INSTALL_PLUGINS, QT_INSTALL_IMPORTS, QT_INSTALL_QML, plugins, imports) copy_translations(install_dir, QT_INSTALL_TRANSLATIONS) - if "LLVM_INSTALL_DIR" in os.environ: - deploy_libclang(install_dir, os.environ["LLVM_INSTALL_DIR"], chrpath_bin) + if args.llvm_path: + deploy_libclang(install_dir, args.llvm_path, chrpath_bin) + if args.elfutils_path: + deploy_elfutils(install_dir, chrpath_bin, args) if not common.is_windows_platform(): print("fixing rpaths...") common.fix_rpaths(install_dir, os.path.join(qt_deploy_prefix, 'lib'), qt_install_info, chrpath_bin) diff --git a/scripts/deployqtHelper_mac.sh b/scripts/deployqtHelper_mac.sh index 8844f8502d..f91423accb 100755 --- a/scripts/deployqtHelper_mac.sh +++ b/scripts/deployqtHelper_mac.sh @@ -133,6 +133,8 @@ if [ $LLVM_INSTALL_DIR ]; then mkdir -p "$libexec_path/clang/lib" cp -Rf "$LLVM_INSTALL_DIR"/lib/libclang.*dylib "$app_path/Contents/Frameworks/" || exit 1 cp -Rf "$LLVM_INSTALL_DIR"/lib/clang "$libexec_path/clang/lib/" || exit 1 + cp -Rf "$LLVM_INSTALL_DIR"/lib/libclang-cpp.dylib "$libexec_path/clang/lib/" || exit 1 + cp -Rf "$LLVM_INSTALL_DIR"/lib/ClazyPlugin.dylib "$libexec_path/clang/lib/" || exit 1 clangsource="$LLVM_INSTALL_DIR"/bin/clang clanglinktarget="$(readlink "$clangsource")" cp -Rf "$clangsource" "$libexec_path/clang/bin/" || exit 1 @@ -145,6 +147,7 @@ if [ $LLVM_INSTALL_DIR ]; then cp -Rf "$clangtidysource" "$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" || exit 1 fi clangbackendArgument="-executable=$libexec_path/clangbackend" clangpchmanagerArgument="-executable=$libexec_path/clangpchmanagerbackend" diff --git a/scripts/shiboken2tasks.py b/scripts/shiboken2tasks.py new file mode 100755 index 0000000000..024f53cd15 --- /dev/null +++ b/scripts/shiboken2tasks.py @@ -0,0 +1,52 @@ +############################################################################ +# +# Copyright (C) 2020 The Qt Company Ltd. +# Contact: https://www.qt.io/licensing/ +# +# This file is part of Qt Creator. +# +# Commercial License Usage +# Licensees holding valid commercial Qt licenses may use this file in +# accordance with the commercial license agreement provided with the +# Software or, alternatively, in accordance with the terms contained in +# a written agreement between you and The Qt Company. For licensing terms +# and conditions see https://www.qt.io/terms-conditions. For further +# information use the contact form at https://www.qt.io/contact-us. +# +# GNU General Public License Usage +# Alternatively, this file may be used under the terms of the GNU +# General Public License version 3 as published by the Free Software +# Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT +# included in the packaging of this file. Please review the following +# information to ensure the GNU General Public License requirements will +# be met: https://www.gnu.org/licenses/gpl-3.0.html. +# +############################################################################ + +''' +shiboken2tasks.py - Convert shiboken warnings into Qt Creator task files. + +SYNOPSIS + + shiboken2tasks.py < logfile > taskfile +''' + +import sys +import re + +if __name__ == '__main__': + # qt.shiboken: (<module>) <file>:<line>:[<column>:] text + pattern = re.compile(r'^qt\.shiboken: \(([^)]+)\) ([^:]+):(\d+):(?:\d+:)? (.*)$') + while True: + line = sys.stdin.readline() + if not line: + break + match = pattern.match(line.rstrip()) + if match: + module = match.group(1) + file_name = match.group(2).replace('\\', '/') + line_number = match.group(3) + text = match.group(4) + output = "{}\t{}\twarn\t{}: {}".format(file_name, line_number, + module, text) + print(output) |