From 6a6aebb84541d02315925b565aa7343c57825799 Mon Sep 17 00:00:00 2001 From: Pawel Kurdybacha Date: Tue, 22 Jan 2019 20:55:06 +0000 Subject: [PATCH] Problem #284: test pthread link error with with gcc Solution: Use Threads cmake module as suggested in this thread: https://cmake.org/pipermail/cmake/2016-February/062729.html I was able to reproduce with gcc 8.2.1 and cmake 3.13.2. --- tests/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index c2a13f0..cc187fb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -10,6 +10,7 @@ set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_LIBDIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_BINDIR}) include(cmake/catch.cmake) +find_package(Threads) add_executable( unit_tests @@ -28,6 +29,7 @@ target_include_directories(unit_tests PUBLIC ${CATCH_INCLUDE_DIR}) target_link_libraries( unit_tests PRIVATE cppzmq + PRIVATE ${CMAKE_THREAD_LIBS_INIT} ) OPTION (COVERAGE "Enable gcda file generation needed by lcov" OFF)