Details
-
Bug
-
Resolution: Fixed
-
Major - P3
-
1.7.0
-
None
-
None
Description
Our CMake check for pthreads is incorrect.
The way we add the build flags is also incorrect, we only link against it with -lpthread, but we are missing the more important part, compiling libbson using -pthread.
cmake 3.1 adds a easy way to do this: https://cmake.org/cmake/help/latest/module/FindThreads.html
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
find_package(Threads REQUIRED)
|
target_link_libraries(bson_shared Threads::Threads)
|
target_link_libraries(bson_static Threads::Threads)
|
The c++ driver requires cmake 3.2, so I think it would be fine if we bump our dependency to 3.1.
Attachments
Issue Links
- is related to
-
CDRIVER-2166 Improve autotools/pkg-config detection
-
- Closed
-
-
CDRIVER-2083 Distribute CMake config packages for statically linking to libbson and libmongoc
-
- Closed
-