Skip to content

Commit

Permalink
update tdlib to 1.8.36 from tdlib/td@87d8810
Browse files Browse the repository at this point in the history
  • Loading branch information
d99kris committed Sep 7, 2024
1 parent 71fc941 commit c22b581
Show file tree
Hide file tree
Showing 135 changed files with 13,738 additions and 12,286 deletions.
2 changes: 1 addition & 1 deletion lib/common/src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@

#pragma once

#define NCHAT_VERSION "5.2.8"
#define NCHAT_VERSION "5.2.9"
46 changes: 36 additions & 10 deletions lib/tgchat/ext/td/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ if (POLICY CMP0065)
cmake_policy(SET CMP0065 NEW)
endif()

project(TDLib VERSION 1.8.35 LANGUAGES CXX C)
project(TDLib VERSION 1.8.36 LANGUAGES CXX C)

if (NOT DEFINED CMAKE_MODULE_PATH)
set(CMAKE_MODULE_PATH "")
Expand Down Expand Up @@ -41,6 +41,9 @@ prevent_in_source_build()

option(TD_ENABLE_JNI "Use \"ON\" to enable JNI-compatible TDLib API.")
option(TD_ENABLE_DOTNET "Use \"ON\" to enable generation of C++/CLI or C++/CX TDLib API bindings.")
if (NOT CMAKE_CROSSCOMPILING)
option(TD_GENERATE_SOURCE_FILES "Use \"ON\" to just generate TDLib source files.")
endif()

if (TD_ENABLE_DOTNET AND (CMAKE_VERSION VERSION_LESS "3.1.0"))
message(FATAL_ERROR "CMake 3.1.0 or higher is required. You are running version ${CMAKE_VERSION}.")
Expand Down Expand Up @@ -114,11 +117,13 @@ if (EMSCRIPTEN)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --post-js ${CMAKE_CURRENT_SOURCE_DIR}/post.js")
endif()

if (NOT OPENSSL_FOUND)
find_package(OpenSSL)
endif()
if (OPENSSL_FOUND)
message(STATUS "Found OpenSSL: ${OPENSSL_INCLUDE_DIR} ${OPENSSL_LIBRARIES}")
if (NOT TD_GENERATE_SOURCE_FILES)
if (NOT OPENSSL_FOUND)
find_package(OpenSSL)
endif()
if (OPENSSL_FOUND)
message(STATUS "Found OpenSSL: ${OPENSSL_INCLUDE_DIR} ${OPENSSL_LIBRARIES}")
endif()
endif()

set(CMAKE_THREAD_PREFER_PTHREAD ON)
Expand All @@ -138,6 +143,11 @@ if (MSVC)
if (TD_ENABLE_MULTI_PROCESSOR_COMPILATION)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP")
endif()

if (TD_ENABLE_JNI)
# https://github.com/tdlib/td/issues/2912
add_definitions(-D_DISABLE_CONSTEXPR_MUTEX_CONSTRUCTOR)
endif()
endif()

if (CLANG OR GCC)
Expand All @@ -163,12 +173,20 @@ configure_file("${CMAKE_CURRENT_SOURCE_DIR}/td/telegram/GitCommitHash.cpp.in" "$

add_subdirectory(tdtl)

if (TD_GENERATE_SOURCE_FILES)
set(TDUTILS_MIME_TYPE ON CACHE BOOL "")
set(TDUTILS_USE_EXTERNAL_DEPENDENCIES OFF CACHE BOOL "")
endif()
add_subdirectory(tdutils)

add_subdirectory(td/generate)

if (NOT CMAKE_CROSSCOMPILING)
add_custom_target(prepare_cross_compiling DEPENDS tl_generate_mtproto tl_generate_common tdmime_auto tl_generate_json)
set(TD_ALWAYS_GENERATE_SOURCE "")
if (TD_GENERATE_SOURCE_FILES)
set(TD_ALWAYS_GENERATE_SOURCE "ALL")
endif()
add_custom_target(prepare_cross_compiling ${TD_ALWAYS_GENERATE_SOURCE} DEPENDS tl_generate_mtproto tl_generate_common tdmime_auto tl_generate_json)
if (TD_ENABLE_DOTNET)
add_custom_target(remove_cpp_documentation
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
Expand All @@ -182,7 +200,9 @@ if (NOT CMAKE_CROSSCOMPILING)
endif()

if (NOT OPENSSL_FOUND)
message(WARNING "Can't find OpenSSL: stop TDLib building")
if (NOT TD_GENERATE_SOURCE_FILES)
message(WARNING "Can't find OpenSSL: stop TDLib building")
endif()
return()
endif()

Expand All @@ -194,8 +214,8 @@ if (NOT ZLIB_FOUND)
return()
endif()

if (NOT TDUTILS_MIME_TYPE)
message(WARNING "Option TDUTILS_MIME_TYPE must not be disabled: stop TDLib building")
if (NOT TDUTILS_MIME_TYPE OR NOT TDUTILS_USE_EXTERNAL_DEPENDENCIES)
message(WARNING "Option TDUTILS_MIME_TYPE and TDUTILS_USE_EXTERNAL_DEPENDENCIES must not be disabled: stop TDLib building")
return()
endif()

Expand Down Expand Up @@ -320,6 +340,7 @@ set(TD_MTPROTO_SOURCE

set(TDLIB_SOURCE_PART1
td/telegram/AccountManager.cpp
td/telegram/AlarmManager.cpp
td/telegram/AnimationsManager.cpp
td/telegram/Application.cpp
td/telegram/AttachMenuManager.cpp
Expand All @@ -337,6 +358,7 @@ set(TDLIB_SOURCE_PART1
td/telegram/BotCommandScope.cpp
td/telegram/BotInfoManager.cpp
td/telegram/BotMenuButton.cpp
td/telegram/BotQueries.cpp
td/telegram/BusinessAwayMessage.cpp
td/telegram/BusinessAwayMessageSchedule.cpp
td/telegram/BusinessBotManageBar.cpp
Expand Down Expand Up @@ -536,6 +558,7 @@ set(TDLIB_SOURCE_PART2
td/telegram/ReplyMarkup.cpp
td/telegram/ReportReason.cpp
td/telegram/RequestedDialogType.cpp
td/telegram/Requests.cpp
td/telegram/RestrictionReason.cpp
td/telegram/SavedMessagesManager.cpp
td/telegram/SavedMessagesTopicId.cpp
Expand Down Expand Up @@ -606,6 +629,7 @@ set(TDLIB_SOURCE_PART2
td/telegram/AccessRights.h
td/telegram/AccountManager.h
td/telegram/AffectedHistory.h
td/telegram/AlarmManager.h
td/telegram/AnimationsManager.h
td/telegram/Application.h
td/telegram/AttachMenuManager.h
Expand All @@ -625,6 +649,7 @@ set(TDLIB_SOURCE_PART2
td/telegram/BotCommandScope.h
td/telegram/BotInfoManager.h
td/telegram/BotMenuButton.h
td/telegram/BotQueries.h
td/telegram/BusinessAwayMessage.h
td/telegram/BusinessAwayMessageSchedule.h
td/telegram/BusinessBotManageBar.h
Expand Down Expand Up @@ -877,6 +902,7 @@ set(TDLIB_SOURCE_PART2
td/telegram/ReportReason.h
td/telegram/RequestActor.h
td/telegram/RequestedDialogType.h
td/telegram/Requests.h
td/telegram/RestrictionReason.h
td/telegram/SavedMessagesManager.h
td/telegram/SavedMessagesTopicId.h
Expand Down
4 changes: 2 additions & 2 deletions lib/tgchat/ext/td/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ TDLib (Telegram Database library) is a cross-platform library for building [Tele
* **Cross-platform**: `TDLib` can be used on Android, iOS, Windows, macOS, Linux, FreeBSD, OpenBSD, NetBSD, illumos, Windows Phone, WebAssembly, watchOS, tvOS, visionOS, Tizen, Cygwin. It should also work on other *nix systems with or without minimal effort.
* **Multilanguage**: `TDLib` can be easily used with any programming language that is able to execute C functions. Additionally, it already has native Java (using `JNI`) bindings and .NET (using `C++/CLI` and `C++/CX`) bindings.
* **Easy to use**: `TDLib` takes care of all network implementation details, encryption and local data storage.
* **High-performance**: in the [Telegram Bot API](https://core.telegram.org/bots/api), each `TDLib` instance handles more than 24000 active bots simultaneously.
* **High-performance**: in the [Telegram Bot API](https://core.telegram.org/bots/api), each `TDLib` instance handles more than 25000 active bots simultaneously.
* **Well-documented**: all `TDLib` API methods and public interfaces are fully documented.
* **Consistent**: `TDLib` guarantees that all updates are delivered in the right order.
* **Reliable**: `TDLib` remains stable on slow and unreliable Internet connections.
Expand Down Expand Up @@ -103,7 +103,7 @@ target_link_libraries(YourTarget PRIVATE Td::TdStatic)

Or you could install `TDLib` and then reference it in your CMakeLists.txt like this:
```
find_package(Td 1.8.35 REQUIRED)
find_package(Td 1.8.36 REQUIRED)
target_link_libraries(YourTarget PRIVATE Td::TdStatic)
```
See [example/cpp/CMakeLists.txt](https://github.com/tdlib/td/blob/master/example/cpp/CMakeLists.txt).
Expand Down
Loading

0 comments on commit c22b581

Please sign in to comment.