Skip to content

Commit

Permalink
CDRIVER-4776 add thread library to pkg-config Libs (#1477)
Browse files Browse the repository at this point in the history
* remove unused `gx_linkopts`

* add thread library to pkg-config libs

Co-authored-by: vector-of-bool <vectorofbool@gmail.com>
  • Loading branch information
kevinAlbs and vector-of-bool authored Nov 29, 2023
1 parent 9fe8af1 commit 9e6a816
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,8 @@ set(THREADS_PREFER_PTHREAD_FLAG TRUE)
find_package(Threads REQUIRED)
mongo_platform_use_target(Threads::Threads)

set_property(DIRECTORY APPEND PROPERTY pkg_config_LIBS ${CMAKE_THREAD_LIBS_INIT})

if(WIN32)
# Required for gethostbyname on Windows:
mongo_platform_link_libraries(ws2_32)
Expand Down
2 changes: 1 addition & 1 deletion build/cmake/GeneratePkgConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ function(_generate_pkg_config_content out)
# XXX: Could we define a genex that can transform the INTERFACE_LINK_LIBRARIES to a list of
# pkg-config-compatible "-l"-flags? That would remove the need to populate pkg_config_LIBS
# manually, and instead rely on target properties to handle transitive dependencies.
string(APPEND libs "$<JOIN:${gx_libs};${gx_linkopts}, >")
string(APPEND libs "$<JOIN:${gx_libs}, >")

# Cflags:
set(cflags)
Expand Down

0 comments on commit 9e6a816

Please sign in to comment.