From 807f1622ea43761612ae65243fdbe618281874ff Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Tue, 7 May 2013 21:39:09 +0200 Subject: [PATCH] Added threading library to link dependencies. Since the GLX backend now uses explicit pthread calls, linking needs to be explicit as well. --- CMakeLists.txt | 5 ++++- tests/CMakeLists.txt | 7 ------- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f39bb95a..6a6f4740 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,7 +162,10 @@ if (_GLFW_X11) # Set up library and include paths list(APPEND glfw_INCLUDE_DIRS ${X11_X11_INCLUDE_PATH}) - list(APPEND glfw_LIBRARIES ${X11_X11_LIB}) + list(APPEND glfw_LIBRARIES ${X11_X11_LIB} ${CMAKE_THREAD_LIBS_INIT}) + if (UNIX AND NOT APPLE) + list(APPEND glfw_LIBRARIES ${RT_LIBRARY}) + endif() # Check for XRandR (modern resolution switching and gamma control) if (NOT X11_Xrandr_FOUND) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b37049f3..70055e2a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -8,11 +8,6 @@ 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}/deps) @@ -61,8 +56,6 @@ set_target_properties(title PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Title") add_executable(windows WIN32 MACOSX_BUNDLE windows.c) set_target_properties(windows PROPERTIES MACOSX_BUNDLE_BUNDLE_NAME "Windows") -target_link_libraries(threads ${thread_LIBRARIES}) - set(WINDOWS_BINARIES accuracy sharing tearing threads title windows) set(CONSOLE_BINARIES clipboard defaults events fsaa fsfocus gamma glfwinfo