diff options
author | Eike Ziller <eike.ziller@qt.io> | 2019-10-29 17:12:33 +0100 |
---|---|---|
committer | Eike Ziller <eike.ziller@qt.io> | 2019-11-04 10:31:55 +0000 |
commit | 53819123e73479b8d9075a86b5a7bef12a87cc26 (patch) | |
tree | 617ebee23a8132fc3b91c604143c94ecb186f212 /src/rpath.pri | |
parent | 5f8efe43f2575b8e4f3f743d12c81051744b9d13 (diff) |
Simplify RPATHs for qmake build
Use central rpath.pri for setting RPATHs and qttestrpath.pri for tests.
Simplify install names of plugins and libraries on macOS to be just
@rpath/libName, which follows convention better and makes setting up
RPATHs easier.
Preparation for moving tools one directory level down on macOS, to
be able to add a qt.conf for the tools generically.
Task-number: QTCREATORBUG-23120
Change-Id: I16625d48904abd3a7f4c2ad7bbba5916cdc400cd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/rpath.pri')
-rw-r--r-- | src/rpath.pri | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/rpath.pri b/src/rpath.pri index 0d8911a4d9..ef0a6b773b 100644 --- a/src/rpath.pri +++ b/src/rpath.pri @@ -1,13 +1,19 @@ -macx { - QMAKE_LFLAGS += -Wl,-rpath,@loader_path/../,-rpath,@executable_path/../ +# set RPATH_BASE to the IDE_..._PATH of the target + +isEmpty(RPATH_BASE): \ + error("You must set RPATH_BASE before including rpath.pri") + +REL_PATH_TO_LIBS = $$relative_path($$IDE_LIBRARY_PATH, $$RPATH_BASE) +REL_PATH_TO_PLUGINS = $$relative_path($$IDE_PLUGIN_PATH, $$RPATH_BASE) + +macos { + QMAKE_LFLAGS += -Wl,-rpath,@loader_path/$$REL_PATH_TO_LIBS,-rpath,@loader_path/$$REL_PATH_TO_PLUGINS } else:linux-* { - #do the rpath by hand since it's not possible to use ORIGIN in QMAKE_RPATHDIR - # this expands to $ORIGIN (after qmake and make), it does NOT read a qmake var QMAKE_RPATHDIR += \$\$ORIGIN - QMAKE_RPATHDIR += \$\$ORIGIN/.. - QMAKE_RPATHDIR += \$\$ORIGIN/../$$IDE_LIBRARY_BASENAME/qtcreator - IDE_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":") + QMAKE_RPATHDIR += \$\$ORIGIN/$$REL_PATH_TO_LIBS + QMAKE_RPATHDIR += \$\$ORIGIN/$$REL_PATH_TO_PLUGINS + IDE_PLUGIN_RPATH = $$join(QMAKE_RPATHDIR, ":") QMAKE_LFLAGS += -Wl,-z,origin \'-Wl,-rpath,$${IDE_PLUGIN_RPATH}\' QMAKE_RPATHDIR = } |