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 <cbodley@redhat.com>
This commit is contained in:
Casey Bodley authored and Vinnie Falco committed 2016-07-21 17:03:17 -04:00
1 parent f8a1ec0348
commit ef2330d477
4 files changed
+8 -8

No files matched your search

+4 -4
View File
@@ -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()