2019-05-23 01:57:00 +03:00
|
|
|
#!/usr/bin/env bash
|
2020-05-06 21:58:41 +03:00
|
|
|
if [ "$1" == "ios" ]; then
|
|
|
|
IOS_BUILD="YES"
|
|
|
|
# Skip building tests on iOS as there is no way to run them
|
|
|
|
BUILD_TESTS="OFF"
|
|
|
|
else
|
|
|
|
IOS_BUILD="NO"
|
|
|
|
BUILD_TESTS="ON"
|
|
|
|
fi
|
|
|
|
|
2019-06-20 00:34:04 +03:00
|
|
|
cd `dirname $0`
|
2020-05-02 21:46:33 +03:00
|
|
|
|
2020-09-22 11:16:29 +03:00
|
|
|
GTEST_PATH=googletest
|
|
|
|
|
|
|
|
# Use latest Google Test for Ubuntu 20.04
|
|
|
|
# TODO: switch all OS builds to Google Test located in third_party/googletest submodule
|
2020-05-02 21:46:33 +03:00
|
|
|
if [ -f /etc/os-release ]; then
|
|
|
|
source /etc/os-release
|
|
|
|
# Use new Google Test on latest Ubuntu 20.04 : old one no longer compiles on 20
|
|
|
|
if [ "$VERSION_ID" == "20.04" ]; then
|
2020-05-03 09:48:59 +03:00
|
|
|
echo Running on Ubuntu 20.04
|
2020-09-22 11:16:29 +03:00
|
|
|
GTEST_PATH=third_party/googletest
|
|
|
|
if [ ! "$(ls -A $GTEST_PATH)" ]; then
|
|
|
|
echo Clone googletest from google/googletest:master ...
|
|
|
|
git clone https://github.com/google/googletest $GTEST_PATH
|
|
|
|
fi
|
2020-05-02 21:46:33 +03:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2020-09-22 11:16:29 +03:00
|
|
|
pushd $GTEST_PATH
|
2019-02-01 12:08:09 +03:00
|
|
|
set -evx
|
|
|
|
env | sort
|
2019-06-20 00:34:04 +03:00
|
|
|
rm -rf build
|
2019-05-23 01:57:00 +03:00
|
|
|
mkdir -p build || true
|
2019-02-01 12:08:09 +03:00
|
|
|
cd build
|
2020-05-03 00:31:54 +03:00
|
|
|
cmake -Dgtest_build_samples=OFF \
|
|
|
|
-Dgmock_build_samples=OFF \
|
2020-10-29 00:29:29 +03:00
|
|
|
-Dgtest_build_tests=OFF \
|
|
|
|
-Dgmock_build_tests=OFF \
|
2019-05-23 01:57:00 +03:00
|
|
|
-DCMAKE_CXX_FLAGS="-fPIC $CXX_FLAGS" \
|
2020-05-06 21:58:41 +03:00
|
|
|
-DBUILD_IOS=$IOS_BUILD \
|
2019-02-01 12:08:09 +03:00
|
|
|
..
|
|
|
|
make
|
2020-09-22 11:16:29 +03:00
|
|
|
popd
|
2020-05-02 21:46:33 +03:00
|
|
|
# CTEST_OUTPUT_ON_FAILURE=1 make test
|
|
|
|
# make install
|