tdlight/example/web/README.md
levlam 5cc40abeba tdweb: add 'init' and 'start' to the list of unsupported methods.
GitOrigin-RevId: 5bdb0dbcfee13fff76312d1408ff7c340732df88
2019-04-24 00:06:39 +03:00

1.1 KiB

TDLib Web example

This is an example of building TDLib for browsers using Emscripten. These scripts build TDLib and creates NPM package tdweb. You need Unix shell with sed, tar and wget utilities to run provided scripts.

Building tdweb NPM package

  • Install latest emsdk. Do not use system-provided emscripten package, because it contains too old version.
  • Install all TDLib build dependencies as described in Building.
  • Run source ./emsdk_env.sh from emsdk directory to set up correct build environment.
  • On macOS install coreutils Homebrew package and replace realpath usages in scripts with grealpath:
brew install coreutils
sed -i.bak 's/[(]realpath/(grealpath/g' build-tdlib.sh
  • Run build scripts in the following order:
cd <path to TDLib sources>/example/web
./build-openssl.sh
./build-tdlib.sh
./copy-tdlib.sh
./build-tdweb.sh