diff options
author | Joerg Bornemann <joerg.bornemann@qt.io> | 2023-02-14 13:59:21 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2023-02-15 17:34:28 +0000 |
commit | e2d1c5d139272164a583ce7d2f1d23164b36180c (patch) | |
tree | ac015b1ab1fe2716877a3aee5484b7cbac9fee2b | |
parent | b8eeb2d68a5eb53905548decb224844d6c5c2284 (diff) |
Revert "CMake: Fix configure -no-rpath"
This reverts commit 854986836a581da694d169744e5487c5ce5f44bf.
This reverts commit 392d9a54194d06e96bfebdaf081aa6c9787e33ab.
Turns out that enabling this option is now breaking the Qt build,
because tools that are called by the Qt build cannot run anymore due to
the lack of rpaths.
Before, QT_DISABLE_RPATH was simply turning off Qt's additional rpaths
but left CMake's rpath defaults intact.
To implement a working -no-rpath switch we must add Linux and macOS code
paths to _qt_internal_generate_tool_command_wrapper and set
LD_LIBRARY_PATH/DYLD_LIBRARY_PATH and friends.
Fixes: QTBUG-110816
Change-Id: I021d5e6cd775cbe5b2411d6771ab2545cb04f799
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 2af494c93076cd2acf4493501e472147422a7670)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | cmake/QtRpathHelpers.cmake | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/cmake/QtRpathHelpers.cmake b/cmake/QtRpathHelpers.cmake index 3dbf5c6764..2150b95e73 100644 --- a/cmake/QtRpathHelpers.cmake +++ b/cmake/QtRpathHelpers.cmake @@ -82,6 +82,12 @@ function(qt_apply_rpaths) return() endif() + # Rpaths explicitly disabled (like for uikit), equivalent to qmake's no_qt_rpath. + # Or feature was turned OFF. + if(QT_DISABLE_RPATH OR NOT QT_FEATURE_rpath) + return() + endif() + cmake_parse_arguments(PARSE_ARGV 0 arg "RELATIVE_RPATH" "TARGET;INSTALL_PATH" @@ -110,21 +116,6 @@ function(qt_apply_rpaths) message(FATAL_ERROR "No INSTALL_PATH given to qt_apply_rpaths.") endif() - # Rpaths explicitly disabled (like for uikit), equivalent to qmake's no_qt_rpath. - # Or feature was turned OFF. - if(QT_DISABLE_RPATH OR NOT QT_FEATURE_rpath) - set_target_properties(${target} PROPERTIES - SKIP_BUILD_RPATH ON - SKIP_INSTALL_RPATH ON - ) - if(APPLE) - set_target_properties(${target} PROPERTIES - MACOSX_RPATH OFF - ) - endif() - return() - endif() - set(rpaths "") # Modify the install path to contain the nested structure of a framework. |