From 7d186516a8f0bcd48193a84c454c6db708e494de Mon Sep 17 00:00:00 2001 From: Nicolas Hake Date: Sun, 13 Dec 2015 14:33:02 +0100 Subject: [PATCH] Tests: Move pthread dependency to gtest The test binaries don't directly use pthread (but gtest does), so the dependency should be added to gtest instead of the binary itself. --- tests/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 2707136dc..4c1927d58 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -77,6 +77,9 @@ if (GTEST_SOURCE_ALL AND GTEST_INCLUDE_DIR) ) if (GTEST_ROOT) include_directories("${GTEST_ROOT}") + endif() + if(HAVE_PTHREAD) + target_link_libraries(gtest pthread) endif() include_directories("${GTEST_INCLUDE_DIR}") set(GTEST_FOUND 1) @@ -101,9 +104,6 @@ if (GTEST_FOUND AND GMOCK_FOUND) if(UNIX AND NOT APPLE) target_link_libraries(tests rt) endif() - if(HAVE_PTHREAD) - target_link_libraries(tests pthread) - endif() if(WIN32) target_link_libraries(tests winmm) endif()