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!
This commit is contained in:
Ethan Lee
2026-07-15 10:05:51 -04:00
parent be29c31511
commit ed795ea457
+8 -7
View File
@@ -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)