Explicitly link against -lpthread on Unix
/usr/bin/ld.lld: error: undefined symbol: pthread_condattr_init >>> referenced by src/3rdParty/salomesmesh/src/SMESH/SMESH_Mesh.cpp >>> src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_Mesh.cpp.o:(boost::condition_variable::condition_variable()) /usr/bin/ld.lld: error: undefined symbol: pthread_condattr_setclock >>> referenced by src/3rdParty/salomesmesh/src/SMESH/SMESH_Mesh.cpp >>> src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_Mesh.cpp.o:(boost::condition_variable::condition_variable()) /usr/bin/ld.lld: error: undefined symbol: pthread_condattr_destroy >>> referenced by src/3rdParty/salomesmesh/src/SMESH/SMESH_Mesh.cpp >>> src/3rdParty/salomesmesh/CMakeFiles/SMESH.dir/src/SMESH/SMESH_Mesh.cpp.o:(boost::condition_variable::condition_variable())
This commit is contained in:
@@ -596,6 +596,11 @@ endif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
|
||||
find_package(Boost ${BOOST_MIN_VERSION}
|
||||
COMPONENTS filesystem program_options regex signals system thread REQUIRED)
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
# Boost.Thread 1.67+ headers reference pthread_condattr_*
|
||||
list(APPEND Boost_LIBRARIES pthread)
|
||||
endif()
|
||||
|
||||
IF(NOT Boost_FOUND)
|
||||
MESSAGE(FATAL_ERROR "========================================\n"
|
||||
"boost not found, install the components:\n"
|
||||
|
||||
Reference in New Issue
Block a user