39 lines
1.4 KiB
Bash
Executable File
39 lines
1.4 KiB
Bash
Executable File
#!/bin/bash -e
|
|
# ====== Setup environment variables
|
|
source ./jenkins/scripts/setup_variables.sh
|
|
|
|
# ====== Setup workspace
|
|
bash ./jenkins/scripts/setup_workspace.sh
|
|
|
|
# ====== Build Td
|
|
# Prepare build
|
|
cd $TD_BUILD_DIR
|
|
nice -n 5 cmake -DCMAKE_BUILD_TYPE=Release -DTD_ENABLE_JNI=ON -DCMAKE_INSTALL_PREFIX:PATH=${TD_BIN_DIR} -DTD_SKIP_BENCHMARK=ON -DTD_SKIP_TEST=OFF -DTD_SKIP_TG_CLI=ON ${TD_SRC_DIR}
|
|
|
|
# Split sources
|
|
nice -n 5 cmake --build $TD_BUILD_DIR --target prepare_cross_compiling -- -j${TRAVIS_CPU_CORES}
|
|
cd $TD_SRC_DIR
|
|
nice -n 5 php SplitSource.php
|
|
|
|
# Build
|
|
cd $TD_BUILD_DIR
|
|
nice -n 5 cmake --build $TD_BUILD_DIR --target install --config Release -- -j${TRAVIS_CPU_CORES}
|
|
|
|
# Undo split-sources
|
|
cd $TD_SRC_DIR
|
|
nice -n 5 php SplitSource.php --undo
|
|
|
|
# ====== Build TdNatives
|
|
cd $TDNATIVES_CPP_BUILD_DIR
|
|
nice -n 5 cmake -DCMAKE_BUILD_TYPE=Release -DTD_BIN_DIR=${TD_BIN_DIR} -DTDNATIVES_BIN_DIR=${TDNATIVES_BIN_DIR} -DTDNATIVES_DOCS_BIN_DIR=${TDNATIVES_DOCS_BIN_DIR} -DTd_DIR=${TD_BIN_DIR}/lib/cmake/Td -DJAVA_SRC_DIR=${JAVA_SRC_DIR} -DTDNATIVES_CPP_SRC_DIR:PATH=$TDNATIVES_CPP_SRC_DIR $TDNATIVES_CPP_SRC_DIR
|
|
nice -n 5 cmake --build $TDNATIVES_CPP_BUILD_DIR --target install --config Release -- -j${TRAVIS_CPU_CORES}
|
|
|
|
# ====== Print results stats
|
|
echo "CCACHE statistics:"
|
|
ccache -s
|
|
|
|
# ====== Copy output
|
|
cd $TDNATIVES_CPP_BUILD_DIR
|
|
mkdir -p $TDLIB_RESOURCES_OUTPUT_DIR
|
|
mv $TDNATIVES_BIN_DIR/$SRC_TDJNI_LIBNAME $TDLIB_RESOURCES_OUTPUT_DIR/$DEST_TDJNI_LIBNAME
|