From 35d0ac29851e79c7b94a68298f3312b19fe99afc Mon Sep 17 00:00:00 2001 From: levlam Date: Thu, 22 Feb 2018 18:44:22 +0300 Subject: [PATCH] Fix CxCli and find_library. GitOrigin-RevId: b3057195dc88b31fc87a1688f470d03e921df99f --- tdutils/CMakeLists.txt | 4 +++- tdutils/td/utils/port/CxCli.h | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tdutils/CMakeLists.txt b/tdutils/CMakeLists.txt index bb3f54a4..463f1834 100644 --- a/tdutils/CMakeLists.txt +++ b/tdutils/CMakeLists.txt @@ -210,7 +210,9 @@ set(TDUTILS_TEST_SOURCE #LIBRARIES add_library(tdutils STATIC ${TDUTILS_SOURCE}) if (WIN32) - target_link_libraries(tdutils PRIVATE ws2_32 Mswsock) + find_library(WS2_32_LIBRARY ws2_32) + find_library(MSWSOCK_LIBRARY Mswsock) + target_link_libraries(tdutils PRIVATE ${WS2_32_LIBRARY} ${MSWSOCK_LIBRARY}) endif() if (NOT CMAKE_CROSSCOMPILING) add_dependencies(tdutils tdmime_auto) diff --git a/tdutils/td/utils/port/CxCli.h b/tdutils/td/utils/port/CxCli.h index acfeec45..bac7a8b0 100644 --- a/tdutils/td/utils/port/CxCli.h +++ b/tdutils/td/utils/port/CxCli.h @@ -49,7 +49,7 @@ public: value = it->second; return true; } - void Remove(Key key, Value &value) { + void TryRemove(Key key, Value &value) { std::lock_guard guard(mutex_); impl_.erase(key); }