From 83a5e3ae07fec3929162894dc6eb9c6c97f14236 Mon Sep 17 00:00:00 2001 From: levlam Date: Sat, 17 Feb 2018 23:52:35 +0300 Subject: [PATCH] Fix linking to dl. GitOrigin-RevId: ff7c6e330ecb07aee8b4f614e86bd5a3f54edce8 --- CMakeLists.txt | 2 +- benchmark/CMakeLists.txt | 4 ++-- sqlite/CMakeLists.txt | 2 +- tdnet/CMakeLists.txt | 4 ++-- tdutils/CMakeLists.txt | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b6ff53c7a0c..a6da9a212268 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -549,7 +549,7 @@ endif() add_library(tdcore STATIC ${TDLIB_SOURCE}) target_include_directories(tdcore PUBLIC $ $) target_include_directories(tdcore SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR}) -target_link_libraries(tdcore PUBLIC tdactor tdutils tdnet tddb PRIVATE ${OPENSSL_CRYPTO_LIBRARY}) +target_link_libraries(tdcore PUBLIC tdactor tdutils tdnet tddb PRIVATE ${OPENSSL_CRYPTO_LIBRARY} ${CMAKE_DL_LIBS}) if (TD_ENABLE_JNI AND NOT ANDROID) # jni is available by default on Android if (NOT JNI_FOUND) diff --git a/benchmark/CMakeLists.txt b/benchmark/CMakeLists.txt index 8830fdd2f859..c4fd8b9aa49e 100644 --- a/benchmark/CMakeLists.txt +++ b/benchmark/CMakeLists.txt @@ -6,10 +6,10 @@ endif() #TODO: all benchmarks in one file add_executable(bench_crypto bench_crypto.cpp) -target_link_libraries(bench_crypto PRIVATE tdcore tdutils ${OPENSSL_CRYPTO_LIBRARY}) +target_link_libraries(bench_crypto PRIVATE tdcore tdutils ${OPENSSL_CRYPTO_LIBRARY} ${CMAKE_DL_LIBS}) target_include_directories(bench_crypto SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR}) if (NOT WIN32) - target_link_libraries(bench_crypto PRIVATE dl z) # for OpenSSL + target_link_libraries(bench_crypto PRIVATE z) # for OpenSSL endif() add_executable(bench_actor bench_actor.cpp) diff --git a/sqlite/CMakeLists.txt b/sqlite/CMakeLists.txt index c1d74d5f9e39..700af45f08e8 100644 --- a/sqlite/CMakeLists.txt +++ b/sqlite/CMakeLists.txt @@ -15,7 +15,7 @@ set(SQLITE_SOURCE add_library(tdsqlite STATIC ${SQLITE_SOURCE}) target_include_directories(tdsqlite PUBLIC $) target_include_directories(tdsqlite SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR}) -target_link_libraries(tdsqlite PRIVATE ${OPENSSL_CRYPTO_LIBRARY}) +target_link_libraries(tdsqlite PRIVATE ${OPENSSL_CRYPTO_LIBRARY} ${CMAKE_DL_LIBS}) target_compile_definitions(tdsqlite PRIVATE -DSQLITE_DEFAULT_MEMSTATUS=0 -DSQLITE_OMIT_LOAD_EXTENSION diff --git a/tdnet/CMakeLists.txt b/tdnet/CMakeLists.txt index f069e6140669..a7e888defabb 100644 --- a/tdnet/CMakeLists.txt +++ b/tdnet/CMakeLists.txt @@ -43,9 +43,9 @@ set(TDNET_SOURCE add_library(tdnet STATIC ${TDNET_SOURCE}) target_include_directories(tdnet PUBLIC $) target_include_directories(tdnet SYSTEM PUBLIC $) -target_link_libraries(tdnet PUBLIC tdutils tdactor ${OPENSSL_LIBRARIES}) +target_link_libraries(tdnet PUBLIC tdutils tdactor ${OPENSSL_LIBRARIES} ${CMAKE_DL_LIBS}) if (UNIX) - target_link_libraries(tdnet PRIVATE dl z) # for OpenSSL + target_link_libraries(tdnet PRIVATE z) # for OpenSSL endif() install(TARGETS tdnet EXPORT TdTargets diff --git a/tdutils/CMakeLists.txt b/tdutils/CMakeLists.txt index 0cf5ec2904ac..893eafac66ce 100644 --- a/tdutils/CMakeLists.txt +++ b/tdutils/CMakeLists.txt @@ -221,9 +221,9 @@ endif() target_include_directories(tdutils PUBLIC $ $) if (OPENSSL_FOUND) - target_link_libraries(tdutils PRIVATE ${OPENSSL_CRYPTO_LIBRARY}) + target_link_libraries(tdutils PRIVATE ${OPENSSL_CRYPTO_LIBRARY} ${CMAKE_DL_LIBS}) if (NOT WIN32) - target_link_libraries(tdutils PRIVATE dl z) + target_link_libraries(tdutils PRIVATE z) endif() target_include_directories(tdutils SYSTEM PRIVATE ${OPENSSL_INCLUDE_DIR}) endif()