2020-08-19 20:13:35 +02:00
|
|
|
#!/bin/bash -e
|
|
|
|
set -e
|
|
|
|
|
|
|
|
# ====== Setup environment variables
|
2020-08-19 20:58:00 +02:00
|
|
|
source ./travis/setup_variables.sh
|
2020-08-19 20:13:35 +02:00
|
|
|
|
|
|
|
# ====== Build Td
|
2020-08-19 21:55:03 +02:00
|
|
|
# Prepare build
|
|
|
|
cd $TD_BUILD_DIR
|
|
|
|
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
2020-08-23 20:50:50 +02:00
|
|
|
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}
|
2020-08-23 19:46:03 +02:00
|
|
|
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
2020-08-23 20:50:50 +02:00
|
|
|
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 -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl/ ${TD_SRC_DIR}
|
2020-08-19 21:55:03 +02:00
|
|
|
elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
|
2020-08-23 20:50:50 +02:00
|
|
|
cmake -A x64 -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 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake ${TD_SRC_DIR}
|
2020-08-19 21:55:03 +02:00
|
|
|
fi
|
|
|
|
|
2020-08-20 01:34:41 +02:00
|
|
|
if [ "$TRAVIS_CPU_ARCH" = "arm64" ]; then
|
|
|
|
while true; do free -h ; sleep 2; done &
|
|
|
|
fi
|
|
|
|
|
2020-08-20 00:09:22 +02:00
|
|
|
# Split sources
|
2020-08-20 09:53:53 +02:00
|
|
|
#if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
|
|
|
# cmake --build $TD_BUILD_DIR --target prepare_cross_compiling -- -j${TRAVIS_CPU_CORES}
|
|
|
|
# cd $TD_SRC_DIR
|
|
|
|
# php SplitSource.php
|
|
|
|
#fi
|
2020-08-19 21:55:03 +02:00
|
|
|
|
2020-08-19 21:27:20 +02:00
|
|
|
# Build
|
2020-08-19 20:13:35 +02:00
|
|
|
cd $TD_BUILD_DIR
|
|
|
|
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
2020-08-20 00:06:47 +02:00
|
|
|
cmake --build $TD_BUILD_DIR --target install --config Release -- -j${TRAVIS_CPU_CORES}
|
2020-08-23 19:46:03 +02:00
|
|
|
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
|
|
|
cmake --build $TD_BUILD_DIR --target install --config Release -- -j${TRAVIS_CPU_CORES}
|
2020-08-19 20:13:35 +02:00
|
|
|
elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
|
2020-08-19 23:41:17 +02:00
|
|
|
cmake --build $TD_BUILD_DIR --target install --config Release -- -m
|
2020-08-19 20:13:35 +02:00
|
|
|
fi
|
|
|
|
|
2020-08-20 00:21:30 +02:00
|
|
|
# Undo split-sources
|
2020-08-20 09:53:53 +02:00
|
|
|
#if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
|
|
|
# cd $TD_SRC_DIR
|
|
|
|
# php SplitSource.php --undo
|
|
|
|
#fi
|
2020-08-19 21:55:03 +02:00
|
|
|
|
2020-08-19 20:13:35 +02:00
|
|
|
# ====== Build TdNatives
|
|
|
|
cd $TDNATIVES_CPP_BUILD_DIR
|
|
|
|
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
|
|
|
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
|
2020-08-20 00:06:47 +02:00
|
|
|
cmake --build $TDNATIVES_CPP_BUILD_DIR --target install -- -j${TRAVIS_CPU_CORES}
|
2020-08-23 19:46:03 +02:00
|
|
|
elif [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
|
|
|
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
|
|
|
|
cmake --build $TDNATIVES_CPP_BUILD_DIR --target install -- -j${TRAVIS_CPU_CORES}
|
2020-08-19 20:13:35 +02:00
|
|
|
elif [[ "$TRAVIS_OS_NAME" == "windows" ]]; then
|
|
|
|
cmake -A x64 -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 -DCMAKE_TOOLCHAIN_FILE:FILEPATH=$VCPKG_DIR/scripts/buildsystems/vcpkg.cmake $TDNATIVES_CPP_SRC_DIR
|
2020-08-19 23:41:17 +02:00
|
|
|
cmake --build $TDNATIVES_CPP_BUILD_DIR --target install --config Release -- -m
|
2020-08-23 17:52:49 +02:00
|
|
|
fi
|