From efc336e60cf1331bf5f3213d296981b87b8b2a6c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 4 Jun 2023 19:24:05 +0300 Subject: =?UTF-8?q?fixes=20#3537=20(Telegram:=2032-=D1=80=D0=B0=D0=B7?= =?UTF-8?q?=D1=80=D1=8F=D0=B4=D0=BD=D0=B0=D1=8F=20=D0=B2=D0=B5=D1=80=D1=81?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BF=D0=B0=D0=B4=D0=B0=D0=B5=D1=82=20=D0=B2=20?= =?UTF-8?q?64-=D1=80=D0=B0=D0=B7=D1=80=D1=8F=D0=B4=D0=BD=D0=BE=D0=B9=20Win?= =?UTF-8?q?dows)=20+=20update=20to=20the=20fresh=20TDLIB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Telegram/tdlib/td/example/ios/README.md | 46 +++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 protocols/Telegram/tdlib/td/example/ios/README.md (limited to 'protocols/Telegram/tdlib/td/example/ios/README.md') diff --git a/protocols/Telegram/tdlib/td/example/ios/README.md b/protocols/Telegram/tdlib/td/example/ios/README.md new file mode 100644 index 0000000000..e8a2f8d183 --- /dev/null +++ b/protocols/Telegram/tdlib/td/example/ios/README.md @@ -0,0 +1,46 @@ +# Universal XCFramework build example + +Below are instructions for building TDLib for iOS, watchOS, tvOS, and also macOS. + +If you need only a macOS build for the current architecture, take a look at [TDLib build instructions generator](https://tdlib.github.io/td/build.html). + +For example of usage take a look at our [Swift example](https://github.com/tdlib/td/tree/master/example/swift). + +To compile `TDLib` you will need to: +* Install the latest Xcode via `xcode-select --install` or downloading it from [Xcode website](https://developer.apple.com/xcode/). + It is not enough to install only command line developer tools to build `TDLib` for iOS. Xcode >= 14.0 is required to build TDLib for watchOS. +* Install other build dependencies using [Homebrew](https://brew.sh): +``` +brew install gperf cmake coreutils +``` +* If you don't want to build `TDLib` for macOS first, you **must** pregenerate required source code files using `CMake` prepare_cross_compiling target: +``` +cd +mkdir native-build +cd native-build +cmake .. +cmake --build . --target prepare_cross_compiling +``` +* Build OpenSSL for iOS, watchOS, tvOS, and macOS: +``` +cd /example/ios +./build-openssl.sh +``` +Here we use scripts from [Python Apple support](https://github.com/beeware/Python-Apple-support), but any other OpenSSL build should work too. +[Python Apple support](https://github.com/beeware/Python-Apple-support) has known problems with spaces in the path to the current directory, so +you need to ensure that there are no spaces in the path. +Built OpenSSL libraries should be stored in the directory `third_party/openssl/`, because the next script will rely on this location. +* Build TDLib for iOS, watchOS, tvOS, and macOS: +``` +cd /example/ios +./build.sh +``` +This may take a while, because TDLib will be built about 16 times. +Resulting XCFramework will work on any architecture and even on a simulator. +We use [CMake/iOS.cmake](https://github.com/tdlib/td/blob/master/CMake/iOS.cmake) toolchain, other toolchains may work too. + +Built libraries and XCFramework will be stored in `tdjson` directory. + +Documentation for all available classes and methods can be found at https://core.telegram.org/tdlib/docs. + +If you receive an "error: SDK "appletvsimulator" cannot be located", you need to run the command "sudo xcode-select -s /Applications/Xcode.app/Contents/Developer" before running ./build.sh. -- cgit v1.2.3