Merge pull request #20 from lopsided98/cmake-threads
Fix build failure by manually linking to thread library
This commit is contained in:
commit
c68a308c71
1 changed files with 10 additions and 0 deletions
|
@ -2,6 +2,7 @@ cmake_minimum_required(VERSION 2.8.3)
|
|||
project(libcreate)
|
||||
|
||||
find_package(Boost REQUIRED system thread)
|
||||
find_package(Threads REQUIRED)
|
||||
|
||||
## Specify additional locations of header files
|
||||
include_directories(
|
||||
|
@ -16,6 +17,15 @@ add_library(create
|
|||
src/packet.cpp
|
||||
)
|
||||
|
||||
if(THREADS_HAVE_PTHREAD_ARG)
|
||||
set_property(TARGET create PROPERTY COMPILE_OPTIONS "-pthread")
|
||||
set_property(TARGET create PROPERTY INTERFACE_COMPILE_OPTIONS "-pthread")
|
||||
endif()
|
||||
|
||||
if(CMAKE_THREAD_LIBS_INIT)
|
||||
target_link_libraries(create "${CMAKE_THREAD_LIBS_INIT}")
|
||||
endif()
|
||||
|
||||
target_link_libraries(create
|
||||
${Boost_LIBRARIES}
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue