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

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