From 6b05f5cca8a84937fb647875c99c34448c235933 Mon Sep 17 00:00:00 2001 From: OatmealDome Date: Sun, 20 Feb 2022 03:09:53 -0500 Subject: [PATCH] DolphinQt: Set the executable's rpath to a lib directory in $ORIGIN on Steam builds for Linux We will store our Qt shared libraries here. --- Source/Core/DolphinQt/CMakeLists.txt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Source/Core/DolphinQt/CMakeLists.txt b/Source/Core/DolphinQt/CMakeLists.txt index 4867d30e9d..79e7105db6 100644 --- a/Source/Core/DolphinQt/CMakeLists.txt +++ b/Source/Core/DolphinQt/CMakeLists.txt @@ -606,6 +606,22 @@ else() install(TARGETS dolphin-emu RUNTIME DESTINATION ${bindir}) endif() +if (CMAKE_SYSTEM_NAME STREQUAL "Linux" AND STEAM) + # Set that we want ORIGIN in FLAGS. + # We also want RPATH, not RUNPATH, so disable the new tags. + target_link_options(dolphin-emu + PRIVATE + LINKER:-z,origin + LINKER:--disable-new-dtags + ) + + # For Steam Runtime builds, our Qt shared libraries will be in a "lib" folder. + set_target_properties(dolphin-emu PROPERTIES + BUILD_WITH_INSTALL_RPATH true + INSTALL_RPATH "\$ORIGIN/lib" + ) +endif() + if(USE_MGBA) target_sources(dolphin-emu PRIVATE GBAHost.cpp