Skip to content

Commit

Permalink
Remove TD_EXPERIMENTAL_WATCH_OS.
Browse files Browse the repository at this point in the history
  • Loading branch information
levlam committed Sep 24, 2021
1 parent a1d1d21 commit 61c3a2b
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 17 deletions.
6 changes: 3 additions & 3 deletions CMake/iOS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ endif (CMAKE_UNAME)
# Force the compilers to gcc for iOS
set (CMAKE_C_COMPILER /usr/bin/gcc)
set (CMAKE_CXX_COMPILER /usr/bin/g++)
set(CMAKE_AR ar CACHE FILEPATH "" FORCE)
set(CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE)
set(PKG_CONFIG_EXECUTABLE pkg-config CACHE FILEPATH "" FORCE)
set (CMAKE_AR ar CACHE FILEPATH "" FORCE)
set (CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE)
set (PKG_CONFIG_EXECUTABLE pkg-config CACHE FILEPATH "" FORCE)

# Setup iOS platform unless specified manually with IOS_PLATFORM
if (NOT DEFINED IOS_PLATFORM)
Expand Down
1 change: 0 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ 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.")
option(TD_EXPERIMENTAL_WATCH_OS "Use \"ON\" to enable watch os support.")

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
4 changes: 1 addition & 3 deletions example/ios/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,8 @@ do
if [[ $platform = "macOS" ]]; then
other_options="-DCMAKE_OSX_ARCHITECTURES='x86_64;arm64'"
else
watchos=""
if [[ $platform = "watchOS" ]]; then
ios_platform="WATCH"
watchos="-DTD_EXPERIMENTAL_WATCH_OS=ON"
elif [[ $platform = "tvOS" ]]; then
ios_platform="TV"
else
Expand All @@ -54,7 +52,7 @@ do
fi

echo "iOS platform = ${ios_platform}"
other_options="${watchos} -DIOS_PLATFORM=${ios_platform} -DCMAKE_TOOLCHAIN_FILE=${td_path}/CMake/iOS.cmake"
other_options="-DIOS_PLATFORM=${ios_platform} -DCMAKE_TOOLCHAIN_FILE=${td_path}/CMake/iOS.cmake"
fi

set_cmake_options $platform
Expand Down
6 changes: 3 additions & 3 deletions td/mtproto/RawConnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#include "td/mtproto/ProxySecret.h"
#include "td/mtproto/Transport.h"

#if TD_EXPERIMENTAL_WATCH_OS
#if TD_DARWIN_WATCH_OS
#include "td/net/DarwinHttp.h"
#endif

Expand Down Expand Up @@ -259,7 +259,7 @@ class RawConnectionDefault final : public RawConnection {
}
};

#if TD_EXPERIMENTAL_WATCH_OS
#if TD_DARWIN_WATCH_OS
class RawConnectionHttp final : public RawConnection {
public:
RawConnectionHttp(IPAddress ip_address, unique_ptr<StatsCallback> stats_callback)
Expand Down Expand Up @@ -452,7 +452,7 @@ class RawConnectionHttp final : public RawConnection {

unique_ptr<RawConnection> RawConnection::create(IPAddress ip_address, SocketFd socket_fd, TransportType transport_type,
unique_ptr<StatsCallback> stats_callback) {
#if TD_EXPERIMENTAL_WATCH_OS
#if TD_DARWIN_WATCH_OS
return td::make_unique<RawConnectionHttp>(ip_address, std::move(stats_callback));
#else
return td::make_unique<RawConnectionDefault>(std::move(socket_fd), transport_type, std::move(stats_callback));
Expand Down
2 changes: 1 addition & 1 deletion td/telegram/net/ConnectionCreator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -705,7 +705,7 @@ Result<SocketFd> ConnectionCreator::find_connection(const Proxy &proxy, const IP
bool prefer_ipv6 =
G()->shared_config().get_option_boolean("prefer_ipv6") || (proxy.use_proxy() && proxy_ip_address.is_ipv6());
bool only_http = proxy.use_http_caching_proxy();
#if TD_EXPERIMENTAL_WATCH_OS
#if TD_DARWIN_WATCH_OS
only_http = true;
#endif
TRY_RESULT(info, dc_options_set_.find_connection(
Expand Down
4 changes: 2 additions & 2 deletions tdnet/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ set(TDNET_SOURCE
td/net/Wget.h
)

if (TD_EXPERIMENTAL_WATCH_OS)
if (APPLE_WATCH)
set(TDNET_SOURCE
${TDNET_SOURCE}
td/net/DarwinHttp.mm
Expand Down Expand Up @@ -77,7 +77,7 @@ if (WIN32)
endif()
endif()

if (TD_EXPERIMENTAL_WATCH_OS)
if (APPLE_WATCH)
find_library(FOUNDATION_LIBRARY Foundation REQUIRED)
target_link_libraries(tdnet PRIVATE ${FOUNDATION_LIBRARY})
endif()
Expand Down
1 change: 0 additions & 1 deletion tdutils/td/utils/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
#cmakedefine01 TD_HAVE_COROUTINES
#cmakedefine01 TD_HAVE_ABSL
#cmakedefine01 TD_FD_DEBUG
#cmakedefine01 TD_EXPERIMENTAL_WATCH_OS
2 changes: 1 addition & 1 deletion tdutils/td/utils/port/SocketFd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ Result<SocketFd> SocketFd::from_native_fd(NativeFd fd) {
}

Result<SocketFd> SocketFd::open(const IPAddress &address) {
#if TD_EXPERIMENTAL_WATCH_OS
#if TD_DARWIN_WATCH_OS
return SocketFd{};
#endif

Expand Down
4 changes: 2 additions & 2 deletions test/http.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//
#include "data.h"

#if TD_EXPERIMENTAL_WATCH_OS
#if TD_DARWIN_WATCH_OS
#include "td/net/DarwinHttp.h"
#endif

Expand Down Expand Up @@ -468,7 +468,7 @@ TEST(Http, gzip_bomb_with_limit) {
ASSERT_TRUE(ok);
}

#if TD_EXPERIMENTAL_WATCH_OS
#if TD_DARWIN_WATCH_OS
struct Baton {
std::mutex mutex;
std::condition_variable cond;
Expand Down

0 comments on commit 61c3a2b

Please sign in to comment.