Commit 757e994eaa8b4ebf276ae5901668bee1110c8d7f

Sam Lantinga 2016-01-07T17:21:50

Fixed --enable-new-dtags check with cmake

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4c0b749..9cf7aab 100755
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -957,12 +957,13 @@ elseif(UNIX AND NOT APPLE)
   if(RPATH)
     set(SDL_RLD_FLAGS "")
     if(BSDI OR FREEBSD OR LINUX OR NETBSD)
-      set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}")
       set(CMAKE_REQUIRED_FLAGS "-Wl,--enable-new-dtags")
       check_c_compiler_flag("" HAVE_ENABLE_NEW_DTAGS)
       set(CMAKE_REQUIRED_FLAGS ${ORIG_CMAKE_REQUIRED_FLAGS})
       if(HAVE_ENABLE_NEW_DTAGS)
-        list(APPEND SDL_RLD_FLAGS "-Wl,--enable-new-dtags")
+        set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir} -Wl,--enable-new-dtags")
+      else()
+        set(SDL_RLD_FLAGS "-Wl,-rpath,\${libdir}")
       endif()
     elseif(SOLARIS)
       set(SDL_RLD_FLAGS "-R\${libdir}")