浏览代码

Added direct dependency on librt for threads test on X11.

Camilla Berglund 13 年之前
父节点
当前提交
2b946289d8
共有 1 个文件被更改,包括 6 次插入1 次删除
  1. 6 1
      tests/CMakeLists.txt

+ 6 - 1
tests/CMakeLists.txt

@@ -8,6 +8,11 @@ else()
     link_libraries(${glfw_LIBRARIES})
 endif()
 
+list(APPEND thread_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
+if (UNIX AND NOT APPLE)
+    list(APPEND thread_LIBRARIES ${RT_LIBRARY})
+endif()
+
 include_directories(${GLFW_SOURCE_DIR}/include
                     ${GLFW_SOURCE_DIR}/support
                     ${OPENGL_INCLUDE_DIR})
@@ -49,7 +54,7 @@ add_executable(windows WIN32 MACOSX_BUNDLE windows.c)
 set_target_properties(windows PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Windows")
 
 if (BUILD_SHARED_LIBS)
-    target_link_libraries(threads ${CMAKE_THREAD_LIBS_INIT})
+    target_link_libraries(threads ${thread_LIBRARIES})
 endif()
 
 set(WINDOWS_BINARIES accuracy sharing tearing threads title windows)