mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Use relative rpath, force relative rpath for older CMake versions
This allows you to copy around the built binaries together with the binaries.
This commit is contained in:
parent
2574c060e4
commit
bda3adabcc
|
@ -1151,6 +1151,14 @@ target_link_libraries(${TARGET_SERVER} ${LIBS_SERVER})
|
||||||
list(APPEND TARGETS_OWN ${TARGET_SERVER})
|
list(APPEND TARGETS_OWN ${TARGET_SERVER})
|
||||||
list(APPEND TARGETS_LINK ${TARGET_SERVER})
|
list(APPEND TARGETS_LINK ${TARGET_SERVER})
|
||||||
|
|
||||||
|
if(ANTIBOT)
|
||||||
|
if(CMAKE_VERSION VERSION_LESS 3.14 AND (CMAKE_VERSION VERSION_GREATER 3.8 OR CMAKE_VERSION VERSION_EQUAL 3.8))
|
||||||
|
set_property(TARGET ${TARGET_SERVER} PROPERTY BUILD_RPATH "$ORIGIN")
|
||||||
|
else()
|
||||||
|
message(STATUS "Can't set BUILD_RPATH in CMake before 3.8, pass -Wl,-rpath,'$ORIGIN' manually if you wish to emulate this. Or just install a newer version of CMake...")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if(TARGET_OS AND TARGET_OS STREQUAL "mac")
|
if(TARGET_OS AND TARGET_OS STREQUAL "mac")
|
||||||
set(SERVER_LAUNCHER_SRC src/osxlaunch/server.mm)
|
set(SERVER_LAUNCHER_SRC src/osxlaunch/server.mm)
|
||||||
set(TARGET_SERVER_LAUNCHER ${TARGET_SERVER}-Launcher)
|
set(TARGET_SERVER_LAUNCHER ${TARGET_SERVER}-Launcher)
|
||||||
|
@ -1679,6 +1687,9 @@ foreach(target ${TARGETS_OWN})
|
||||||
set_property(TARGET ${target} PROPERTY CXX_STANDARD 11)
|
set_property(TARGET ${target} PROPERTY CXX_STANDARD 11)
|
||||||
set_property(TARGET ${target} PROPERTY CXX_STANDARD_REQUIRED ON)
|
set_property(TARGET ${target} PROPERTY CXX_STANDARD_REQUIRED ON)
|
||||||
endif()
|
endif()
|
||||||
|
if(CMAKE_VERSION VERSION_GREATER 3.14 OR CMAKE_VERSION VERSION_EQUAL 3.14)
|
||||||
|
set_property(TARGET ${TARGET_SERVER} PROPERTY BUILD_RPATH_USE_ORIGIN TRUE)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(MSVC)
|
if(MSVC)
|
||||||
target_compile_options(${target} PRIVATE /wd4244) # Possible loss of data (float -> int, int -> float, etc.).
|
target_compile_options(${target} PRIVATE /wd4244) # Possible loss of data (float -> int, int -> float, etc.).
|
||||||
|
|
Loading…
Reference in a new issue