This repository has been archived on 2020-05-25. You can view files and clone it, but cannot push or open issues or pull requests.
tdlib-fork/example/ios
levlam 47eaae2a69 Tab fix.
GitOrigin-RevId: 25486b7560f2f9e150dce69d066015d1b1b4aa64
2018-02-15 19:28:28 +03:00
..
build-openssl.sh Update iOS example README.md. 2018-02-15 00:41:26 +03:00
build.sh Tab fix. 2018-02-15 19:28:28 +03:00
README.md Update iOS example README.md. 2018-02-15 00:41:26 +03:00

Build for iOS

Below are instructions for building TDLib for iOS, watchOS, tvOS, and also macOS.

If you need only a macOS build, take a look at our build instructions for macOS.

For example of usage take a look at our Swift example.

To compile TDLib you will need to:

  • Install the latest Xcode command line tools.
  • Install other build dependencies, for example, using Homebrew:
brew install gperf cmake
  • If you don't want to build TDLib for macOS, you can pregenerate required source code files using CMake prepare_cross_compiling target:
cd <path to TDLib sources>
mkdir native-build
cd native-build
cmake ..
cmake --build . --target prepare_cross_compiling
  • Build OpenSSL for iOS, watchOS, tvOS and macOS:
cd <path to TDLib sources>/example/ios
./build-openssl.sh

Here we use scripts from Python Apple support, but any other OpenSSL builds should work too. Built libraries should be stored in third_party/openssl/<platform>, because the next script will rely on this location.

  • Build TDLib for iOS, watchOS, tvOS and macOS:
cd <path to TDLib sources>/example/ios
./build.sh

This may take a while, because TDLib will be built about 10 times. Resulting library for iOS will work on any architecture (arv7, armv7s, arm64) and even on a simulator. We use CMake/iOS.cmake toolchain, other toolchains may work too.

Built libraries will be store in tdjson directory.