From ed795ea457afce28fcd336a670d6b1d7d5c53bad Mon Sep 17 00:00:00 2001 From: Ethan Lee Date: Wed, 15 Jul 2026 10:05:51 -0400 Subject: [PATCH] CMake: Rework Linux RPATH generation. This is mostly to fix the AArch64 rpath. i686 will be different after this change, but I haven't been shipping that architecture for a while now... Also, took out BIN_LIBROOT which wasn't doing anything, woops! --- desktop_version/CMakeLists.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/desktop_version/CMakeLists.txt b/desktop_version/CMakeLists.txt index 4a331513..531d34b5 100644 --- a/desktop_version/CMakeLists.txt +++ b/desktop_version/CMakeLists.txt @@ -49,15 +49,16 @@ endif() # RPATH if(NOT WIN32) if(APPLE) - set(BIN_LIBROOT "osx") set(BIN_RPATH "@executable_path/osx") - elseif(CMAKE_SIZEOF_VOID_P MATCHES "8") - set(BIN_LIBROOT "lib64") - set(BIN_RPATH "\$ORIGIN/lib64") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--disable-new-dtags") else() - set(BIN_LIBROOT "lib") - set(BIN_RPATH "\$ORIGIN/lib") + SET(CMAKE_EXE_LINKER_FLAGS ${CMAKE_EXE_LINKER_FLAGS} "-Wl,--disable-new-dtags") + + if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64") + # Naming quirk for backward compatibility + SET(BIN_RPATH "\$ORIGIN/lib64") + else() + SET(BIN_RPATH "\$ORIGIN/lib${CMAKE_SYSTEM_PROCESSOR}") + endif() endif() set(CMAKE_SKIP_BUILD_RPATH TRUE) set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE)