1
0
mirror of https://github.com/codership/wsrep-lib.git synced 2025-06-11 16:48:11 +03:00

Check existence if dl library.

All platforms do not have dl library, but dlopen() and friends
are included in libc.

Check existence of dl lib and store into WSREP_LIB_LIBDL if found.
This commit is contained in:
Teemu Ollakka
2020-07-31 11:13:15 +03:00
parent 3e5a28df32
commit ae4e58ba03
2 changed files with 10 additions and 1 deletions

View File

@ -26,6 +26,7 @@ else()
endif()
include(CheckIncludeFile)
include(CheckLibraryExists)
# Options
@ -93,6 +94,14 @@ endif()
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/include")
include_directories("${CMAKE_CURRENT_SOURCE_DIR}/wsrep-API")
# Find libraries.
CHECK_LIBRARY_EXISTS(dl dlopen "" WSREP_LIB_HAVE_LIBDL)
if (WSREP_LIB_HAVE_LIBDL)
set(WSREP_LIB_LIBDL "dl")
else()
set(WSREP_LIB_LIBDL "")
endif()
if (WSREP_LIB_WITH_UNIT_TESTS)
find_package(Boost 1.54.0 REQUIRED
unit_test_framework

View File

@ -19,4 +19,4 @@ add_library(wsrep-lib
transaction.cpp
uuid.cpp
wsrep_provider_v26.cpp)
target_link_libraries(wsrep-lib wsrep_api_v26 pthread dl)
target_link_libraries(wsrep-lib wsrep_api_v26 pthread ${WSREP_LIB_LIBDL})