From 05a5abbfbd016de54ee9fcb013468250ca1e8683 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 | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/desktop_version/CMakeLists.txt b/desktop_version/CMakeLists.txt index 900ace70..4112a7c8 100644 --- a/desktop_version/CMakeLists.txt +++ b/desktop_version/CMakeLists.txt @@ -51,18 +51,18 @@ endif() # RPATH if(NOT WIN32) if(CMAKE_SYSTEM_NAME STREQUAL "iOS") - set(BIN_LIBROOT "Frameworks") set(BIN_RPATH "@executable_path/Frameworks") elseif(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)