CMakeLists.txt
changeset 10044 8fc20bbbed5c
parent 10043 24e8d042e532
child 10047 281d1bfdacb1
--- a/CMakeLists.txt	Thu Jan 07 16:42:30 2016 -0800
+++ b/CMakeLists.txt	Thu Jan 07 17:21:50 2016 -0800
@@ -957,12 +957,13 @@
   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}")