From 4e0d7598e10a83ea416c6cf244b13181dd875cb9 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sun, 17 Mar 2024 15:56:29 +1100 Subject: [PATCH] omg --- source/CMakeLists.txt | 10 ++++------ source/client/CMakeLists.txt | 4 ++++ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt index 3c49d53..2994a43 100644 --- a/source/CMakeLists.txt +++ b/source/CMakeLists.txt @@ -275,8 +275,6 @@ if(STAR_COMPILER_GNU) set(CMAKE_C_FLAGS_RELEASE "-DNDEBUG -Ofast") set(CMAKE_CXX_FLAGS_RELEASE "-DNDEBUG -Ofast") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-rpath,$ORIGIN") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,$ORIGIN") set(CMAKE_SKIP_BUILD_RPATH TRUE) elseif(STAR_COMPILER_CLANG) @@ -285,15 +283,15 @@ elseif(STAR_COMPILER_CLANG) if(STAR_SYSTEM_MACOS) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-export_dynamic,-rpath,$ORIGIN") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-export_dynamic,-rpath,$ORIGIN") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-export_dynamic") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-export_dynamic") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++17") set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++") elseif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread -D_REENTRANT") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread -D_REENTRANT") - set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--export_dynamic,-rpath,$ORIGIN") - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--export_dynamic,-rpath,$ORIGIN") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--export_dynamic") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--export_dynamic") endif() set(CMAKE_C_FLAGS_DEBUG "-g") diff --git a/source/client/CMakeLists.txt b/source/client/CMakeLists.txt index 0ca0eaf..57b8231 100644 --- a/source/client/CMakeLists.txt +++ b/source/client/CMakeLists.txt @@ -33,4 +33,8 @@ IF(STAR_PRECOMPILED_HEADERS) TARGET_PRECOMPILE_HEADERS (starbound REUSE_FROM star_core) ENDIF() +IF(UNIX) + set_target_properties (starbound PROPERTIES LINK_FLAGS "-Wl,-rpath,'$ORIGIN'") +ENDIF() + TARGET_LINK_LIBRARIES (starbound ${STAR_EXT_LIBS} ${STAR_EXT_GUI_LIBS}) \ No newline at end of file