From d10ab196f585a53b4d39c9f5db08817bd8ec1c1d Mon Sep 17 00:00:00 2001 From: heinrich5991 Date: Sat, 18 Mar 2017 01:20:55 +0100 Subject: [PATCH] Fix link order for the client libraries Fixes #686. --- CMakeLists.txt | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f3102aa99..da8259883 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -120,7 +120,11 @@ if(TARGET_OS STREQUAL "windows") set(PLATFORM_LIBS ws2_32) # Windows sockets else() set(PLATFORM_CLIENT_LIBS GL GLU X11) - set(PLATFORM_LIBS) + if(TARGET_OS STREQUAL "linux") + set(PLATFORM_LIBS rt) # clock_gettime for glibc < 2.17 + else() + set(PLATFORM_LIBS) + endif() endif() if(CMAKE_CXX_COMPILER_ID MATCHES Clang OR CMAKE_CXX_COMPILER_ID MATCHES GNU) @@ -276,10 +280,13 @@ if(CLIENT) ${LIBS} ${CURL_LIBRARIES} ${FREETYPE_LIBRARIES} - ${OGG_LIBRARIES} + ${SDL2_LIBRARIES} + + # Order of these three is important. ${OPUSFILE_LIBRARIES} ${OPUS_LIBRARIES} - ${SDL2_LIBRARIES} + ${OGG_LIBRARIES} + ${PLATFORM_CLIENT_LIBS} )