Skip to content

Commit

Permalink
Merge branch 'tdlib:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
pylakey authored Jun 12, 2024
2 parents ceee1ad + 4257a34 commit d7a3cd7
Show file tree
Hide file tree
Showing 1,297 changed files with 80,099 additions and 41,722 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
**/.DS_Store
**/auto/
docs/
tdlib/
/tdlib/
vcpkg/
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -1087,9 +1087,9 @@ Changes in 1.4.0 (1 May 2019):
the class `scopeNotificationSettings`.
- Added the class `PushMessageContent` describing the content of a notification, received through
a push notification.
- Added the class `NotificationType` describing a type of a notification.
- Added the class `NotificationType` describing a type of notification.
- Added the class `notification` containing information about a notification.
- Added the class `NotificationGroupType` describing a type of a notification group.
- Added the class `NotificationGroupType` describing a type of notification group.
- Added the class `notificationGroup` describing a state of a notification group.
- Added the methods `removeNotification` and `removeNotificationGroup` for handling notifications removal
by the user.
Expand Down Expand Up @@ -1226,7 +1226,7 @@ Changes in 1.4.0 (1 May 2019):
* Removed the `on_closed` callback virtual method from low-level C++ ClientActor interface.
Callback destructor can be used instead.
* Updated dependencies in the prebuilt TDLib for Android:
- Updated SDK to SDK 28 in which helper classes was moved from `android.support.` to `androidx.` package.
- Updated SDK to SDK 28 in which helper classes were moved from `android.support.` to `androidx.` package.
- Updated NDK to r19c, which dropped support for Android versions up to 4.0.4, so the minimum supported version is
Android 4.1.
- Updated OpenSSL to version 1.1.1.
Expand Down
62 changes: 62 additions & 0 deletions CMake/FindAtomics.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Original issue:
# * https://gitlab.kitware.com/cmake/cmake/-/issues/23021#note_1098733
#
# For reference:
# * https://gcc.gnu.org/wiki/Atomic/GCCMM
#
# riscv64 specific:
# * https://lists.debian.org/debian-riscv/2022/01/msg00009.html
#
# ATOMICS_FOUND - system has C++ atomics
# ATOMICS_LIBRARIES - libraries needed to use C++ atomics

if (ATOMICS_FOUND)
return()
endif()

include(CheckCXXSourceCompiles)

# RISC-V only has 32-bit and 64-bit atomic instructions. GCC is supposed
# to convert smaller atomics to those larger ones via masking and
# shifting like LLVM, but it's a known bug that it does not. This means
# anything that wants to use atomics on 1-byte or 2-byte types needs
# to link atomic library, but not 4-byte or 8-byte (though it does no harm).
set(ATOMIC_CODE
"
#include <atomic>
#include <cstdint>
std::atomic<std::uint8_t> n8{0}; // riscv64
std::atomic<std::uint64_t> n64{0}; // armel, mipsel, powerpc
int main() {
++n8;
++n64;
}")

set(ATOMICS_LIBS " " "-latomic")
if (CMAKE_SYSTEM_NAME MATCHES "NetBSD")
set(ATOMICS_LIBS "${ATOMICS_LIBS}" /usr/pkg/gcc12/x86_64--netbsd/lib/libatomic.so /usr/pkg/gcc12/i486--netbsdelf/lib/libatomic.so)
endif()

foreach (ATOMICS_LIBRARY ${ATOMICS_LIBS})
unset(ATOMICS_FOUND CACHE)
set(CMAKE_REQUIRED_LIBRARIES "${ATOMICS_LIBRARY}")
check_cxx_source_compiles("${ATOMIC_CODE}" ATOMICS_FOUND)
unset(CMAKE_REQUIRED_LIBRARIES)
if (ATOMICS_FOUND)
if (NOT ATOMICS_LIBRARY STREQUAL " ")
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(Atomics DEFAULT_MSG ATOMICS_LIBRARY)
set(ATOMICS_LIBRARIES "${ATOMICS_LIBRARY}" CACHE STRING "Atomic library" FORCE)
else()
set(ATOMICS_LIBRARIES "" CACHE STRING "Atomic operations library" FORCE)
endif()
break()
endif()
endforeach()
if (Atomics_FIND_REQUIRED AND NOT ATOMICS_FOUND)
message(FATAL_ERROR "Atomic operations library isn't found.")
endif()

unset(ATOMICS_LIBRARY)
unset(ATOMICS_LIBS)
unset(ATOMIC_CODE)
1 change: 1 addition & 0 deletions CMake/GeneratePkgConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ function(get_relative_link OUTPUT PATH)
set(${OUTPUT} "${LINK}" PARENT_SCOPE)
endfunction()

# TODO: support interface libraries in dependencies
function(generate_pkgconfig TARGET DESCRIPTION)
# message("Generating pkg-config for ${TARGET}")
get_filename_component(PREFIX "${CMAKE_INSTALL_PREFIX}" REALPATH)
Expand Down
2 changes: 1 addition & 1 deletion CMake/GetGitRevisionDescription.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function(get_git_head_revision _refspecvar _hashvar)
return()
endif()

find_package(Git)
find_package(Git QUIET)

# Check if the current source dir is a git submodule or a worktree.
# In both cases .git is a file instead of a directory.
Expand Down
3 changes: 3 additions & 0 deletions CMake/TdSetUpCompiler.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ function(td_set_up_compiler)
set(TD_LINKER_FLAGS "-Wl,-z,ignore")
elseif (EMSCRIPTEN)
set(TD_LINKER_FLAGS "-Wl,--gc-sections")
elseif (ANDROID)
set(TD_LINKER_FLAGS "-Wl,--gc-sections -Wl,--exclude-libs,ALL -Wl,--icf=safe")
else()
set(TD_LINKER_FLAGS "-Wl,--gc-sections -Wl,--exclude-libs,ALL")
endif()
Expand Down Expand Up @@ -124,6 +126,7 @@ function(td_set_up_compiler)
add_cxx_compiler_flag("-Wno-unknown-warning-option")
add_cxx_compiler_flag("-Wodr")
add_cxx_compiler_flag("-flto-odr-type-merging")
add_cxx_compiler_flag("-Wno-psabi")

# add_cxx_compiler_flag("-Werror")

Expand Down
25 changes: 23 additions & 2 deletions CMake/iOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ set (CMAKE_OSX_DEPLOYMENT_TARGET "" CACHE STRING "Force unset of the deployment
# Determine the cmake host system version so we know where to find the iOS SDKs
find_program (CMAKE_UNAME uname /bin /usr/bin /usr/local/bin)
if (CMAKE_UNAME)
exec_program(uname ARGS -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION)
execute_process(COMMAND uname -r OUTPUT_VARIABLE CMAKE_HOST_SYSTEM_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
string (REGEX REPLACE "^([0-9]+)\\.([0-9]+).*$" "\\1" DARWIN_MAJOR_VERSION "${CMAKE_HOST_SYSTEM_VERSION}")
endif (CMAKE_UNAME)

Expand Down Expand Up @@ -114,6 +114,23 @@ elseif (IOS_PLATFORM STREQUAL "TVSIMULATOR")
set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-tvsimulator")

set (APPLE_TV True)
elseif (IOS_PLATFORM STREQUAL "VISIONOS")
set (IOS_PLATFORM_LOCATION "XROS.platform")
set (XCODE_IOS_PLATFORM xros)

# This causes the installers to properly locate the output libraries
set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-xros")

set (APPLE_VISION True)
elseif (IOS_PLATFORM STREQUAL "VISIONSIMULATOR")
set (SIMULATOR_FLAG true)
set (IOS_PLATFORM_LOCATION "XRSimulator.platform")
set (XCODE_IOS_PLATFORM xros-simulator)

# This causes the installers to properly locate the output libraries
set (CMAKE_XCODE_EFFECTIVE_PLATFORMS "-xrsimulator")

set (APPLE_VISION True)
else (IOS_PLATFORM STREQUAL "OS")
message (FATAL_ERROR "Unsupported IOS_PLATFORM value selected. Please choose OS, SIMULATOR, or WATCHOS.")
endif ()
Expand Down Expand Up @@ -163,7 +180,7 @@ set (IOS_DEPLOYMENT_TARGET ${IOS_DEPLOYMENT_TARGET} CACHE STRING "Minimum iOS ve

# Setup iOS developer location unless specified manually with CMAKE_IOS_DEVELOPER_ROOT
# Note Xcode 4.3 changed the installation location, choose the most recent one available
exec_program(/usr/bin/xcode-select ARGS -print-path OUTPUT_VARIABLE CMAKE_XCODE_DEVELOPER_DIR)
execute_process(COMMAND /usr/bin/xcode-select -print-path OUTPUT_VARIABLE CMAKE_XCODE_DEVELOPER_DIR OUTPUT_STRIP_TRAILING_WHITESPACE)
set (XCODE_POST_43_ROOT "${CMAKE_XCODE_DEVELOPER_DIR}/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
set (XCODE_PRE_43_ROOT "/Developer/Platforms/${IOS_PLATFORM_LOCATION}/Developer")
if (NOT DEFINED CMAKE_IOS_DEVELOPER_ROOT)
Expand Down Expand Up @@ -212,6 +229,10 @@ if (NOT DEFINED IOS_ARCH)
set (IOS_ARCH "arm64")
elseif (IOS_PLATFORM STREQUAL "TVSIMULATOR")
set (IOS_ARCH "x86_64;arm64")
elseif (IOS_PLATFORM STREQUAL "VISIONOS")
set (IOS_ARCH "arm64")
elseif (IOS_PLATFORM STREQUAL "VISIONSIMULATOR")
set (IOS_ARCH "x86_64;arm64")
endif()
endif()
message (STATUS "The iOS architectures: ${IOS_ARCH}")
Expand Down
Loading

0 comments on commit d7a3cd7

Please sign in to comment.