diff options
author | Eike Ziller <eike.ziller@theqtcompany.com> | 2016-05-13 14:53:50 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2016-05-13 12:58:41 +0000 |
commit | ae3b4f1a061149c5bda15b8ff8d62939719f338f (patch) | |
tree | 883747cbd7311beebded3c964c2127fb84664ea3 /scripts | |
parent | 8b78231356ad6052bec277090fe0bd44ef5e6138 (diff) | |
download | qt-creator-ae3b4f1a061149c5bda15b8ff8d62939719f338f.tar.gz |
Linux deployment: Only add RPATH to Qt if necessary
Don't try to add an RPATH to Qt if the library/executable
does not link to Qt. Chances are, that the reserved space
for the RPATH is too short in that case.
Change-Id: Ie8d50ede43d19236611fe56667995e58606062db
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/common.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/scripts/common.py b/scripts/common.py index fd724f1e94..22fcca9872 100644 --- a/scripts/common.py +++ b/scripts/common.py @@ -125,15 +125,18 @@ def fix_rpaths(path, qt_deploy_path, qt_install_info, chrpath=None): new_rpath = filter(lambda path: not path.startswith(qt_install_prefix) and not path.startswith(qt_install_libs), rpath) - # add Qt RPATH if necessary - relative_path = os.path.relpath(qt_deploy_path, os.path.dirname(filepath)) - if relative_path == '.': - relative_path = '' - else: - relative_path = '/' + relative_path - qt_rpath = '$ORIGIN' + relative_path - if not any((path == qt_rpath) for path in rpath): - new_rpath.append(qt_rpath) + # check for Qt linking + lddOutput = subprocess.check_output(['ldd', filepath]) + if lddOutput.find('libQt5') >= 0 or lddOutput.find('libicu') >= 0: + # add Qt RPATH if necessary + relative_path = os.path.relpath(qt_deploy_path, os.path.dirname(filepath)) + if relative_path == '.': + relative_path = '' + else: + relative_path = '/' + relative_path + qt_rpath = '$ORIGIN' + relative_path + if not any((path == qt_rpath) for path in rpath): + new_rpath.append(qt_rpath) # change RPATH if len(new_rpath) > 0: |