More tdweb build scripts improvements.

GitOrigin-RevId: 37253862aac68213c3d81c0fe4ea6565d0b1f8a6
This commit is contained in:
levlam 2018-12-23 23:25:26 +03:00
parent 209b9454d9
commit c858a343fa
3 changed files with 18 additions and 5 deletions

View File

@ -1,5 +1,11 @@
#!/bin/sh
emconfigure || { echo 'emconfigure not found. Install Emscripten and add emconfigure to PATH environment variable'; exit 1; }
rm -rf build/generate
rm -rf build/asmjs
rm -rf build/wasm
mkdir -p build/generate
mkdir -p build/asmjs
mkdir -p build/wasm
@ -20,12 +26,12 @@ OPENSSL_OPTIONS="-DOPENSSL_FOUND=1 \
pushd .
cd build/wasm
eval emconfigure cmake $TD_ROOT -GNinja $OPENSSL_OPTIONS || exit 1
eval emconfigure cmake $TD_ROOT $OPENSSL_OPTIONS || exit 1
popd
pushd .
cd build/asmjs
eval emconfigure cmake $TD_ROOT -GNinja -DASMJS=1 $OPENSSL_OPTIONS || exit 1
eval emconfigure cmake $TD_ROOT $OPENSSL_OPTIONS -DASMJS=1 || exit 1
popd
pushd .
@ -33,6 +39,9 @@ cd build/generate
cmake $TD_ROOT -GNinja || exit 1
popd
cmake --build build/generate -j --target prepare_cross_compiling || exit 1
cmake --build build/wasm -j --target td_wasm || exit 1
cmake --build build/asmjs -j --target td_asmjs || exit 1
echo "Generating TDLib autogenerated source files..."
cmake --build build/generate --target prepare_cross_compiling || exit 1
echo "Building TDLib to WebAssembly..."
cmake --build build/wasm --target td_wasm || exit 1
echo "Building TDLib to asm.js..."
cmake --build build/asmjs --target td_asmjs || exit 1

View File

@ -1,3 +1,5 @@
#!/bin/sh
pushd .
cd tdweb
npm install || exit 1

View File

@ -1,3 +1,5 @@
#!/bin/sh
DEST=tdweb/src/prebuilt/release/
mkdir -p $DEST
cp build/wasm/td_wasm.{js,wasm} $DEST