From 28bd98073ede6da4c6df1ae6a3ab5af8d781953e Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 15 Jun 2016 22:03:18 -0400 Subject: [PATCH] Use Threads::Threads interface library in cmake in addition to passing ${CMAKE_THREAD_LIBS_INIT} to the linker, this interface library will also add -pthread to the compile options when supported Signed-off-by: Casey Bodley --- examples/CMakeLists.txt | 8 ++++---- test/core/CMakeLists.txt | 2 +- test/http/CMakeLists.txt | 2 +- test/websocket/CMakeLists.txt | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/examples/CMakeLists.txt b/examples/CMakeLists.txt index fea89e64..a67c0d8b 100644 --- a/examples/CMakeLists.txt +++ b/examples/CMakeLists.txt @@ -13,7 +13,7 @@ add_executable (http-crawl ) if (NOT WIN32) - target_link_libraries(http-crawl ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(http-crawl ${Boost_LIBRARIES} Threads::Threads) endif() add_executable (http-server @@ -26,7 +26,7 @@ add_executable (http-server ) if (NOT WIN32) - target_link_libraries(http-server ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(http-server ${Boost_LIBRARIES} Threads::Threads) endif() add_executable (http-example @@ -35,7 +35,7 @@ add_executable (http-example ) if (NOT WIN32) - target_link_libraries(http-example ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(http-example ${Boost_LIBRARIES} Threads::Threads) endif() add_executable (websocket-example @@ -44,5 +44,5 @@ add_executable (websocket-example ) if (NOT WIN32) - target_link_libraries(websocket-example ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(websocket-example ${Boost_LIBRARIES} Threads::Threads) endif() diff --git a/test/core/CMakeLists.txt b/test/core/CMakeLists.txt index 3cc71b05..b7ce10c9 100644 --- a/test/core/CMakeLists.txt +++ b/test/core/CMakeLists.txt @@ -34,5 +34,5 @@ add_executable (core-tests ) if (NOT WIN32) - target_link_libraries(core-tests ${Boost_LIBRARIES}) + target_link_libraries(core-tests ${Boost_LIBRARIES} Threads::Threads) endif() diff --git a/test/http/CMakeLists.txt b/test/http/CMakeLists.txt index 05a2998a..233ea65e 100644 --- a/test/http/CMakeLists.txt +++ b/test/http/CMakeLists.txt @@ -31,7 +31,7 @@ add_executable (http-tests ) if (NOT WIN32) - target_link_libraries(http-tests ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(http-tests ${Boost_LIBRARIES} Threads::Threads) endif() add_executable (bench-tests diff --git a/test/websocket/CMakeLists.txt b/test/websocket/CMakeLists.txt index 7a52207b..b9cc469a 100644 --- a/test/websocket/CMakeLists.txt +++ b/test/websocket/CMakeLists.txt @@ -21,7 +21,7 @@ add_executable (websocket-tests ) if (NOT WIN32) - target_link_libraries(websocket-tests ${Boost_LIBRARIES}) + target_link_libraries(websocket-tests ${Boost_LIBRARIES} Threads::Threads) endif() add_executable (websocket-echo @@ -32,5 +32,5 @@ add_executable (websocket-echo ) if (NOT WIN32) - target_link_libraries(websocket-echo ${Boost_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT}) + target_link_libraries(websocket-echo ${Boost_LIBRARIES} Threads::Threads) endif()