2018-02-18 03:54:22 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
2018-09-27 11:23:05 +02:00
|
|
|
set -ev
|
|
|
|
|
|
|
|
# If using gcc on mac, actually use it ("gcc" just links to clang, but "gcc-4.8" is gcc, https://github.com/travis-ci/travis-ci/issues/2423)
|
|
|
|
# Note: This must be here and not in install.sh, because environment variables can't be passed between scripts.
|
2018-09-27 11:25:56 +02:00
|
|
|
if [ "${CXX}" == "g++" ]; then
|
2018-09-27 11:23:05 +02:00
|
|
|
echo Switch to actual g++ and not just the AppleClang symlink
|
|
|
|
export CXX="g++-7" CC="gcc-7"
|
|
|
|
else
|
2018-09-27 11:25:56 +02:00
|
|
|
echo Do not switch to actual g++ because we are not g++
|
2018-09-27 11:23:05 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Setup ccache
|
|
|
|
export PATH="/usr/local/opt/ccache/libexec:$PATH"
|
|
|
|
export CCACHE_COMPILERCHECK=content
|
|
|
|
export CCACHE_COMPRESS=1
|
|
|
|
export CCACHE_SLOPPINESS=include_file_mtime
|
|
|
|
ccache --max-size=512M
|
|
|
|
ccache --show-stats
|
2018-02-18 03:54:22 +01:00
|
|
|
|
|
|
|
# Detect number of CPU cores
|
2018-09-27 11:25:56 +02:00
|
|
|
export NUMCORES=`sysctl -n hw.ncpu`
|
2018-02-18 03:54:22 +01:00
|
|
|
echo Using $NUMCORES cores
|
|
|
|
|
2018-09-27 11:23:05 +02:00
|
|
|
echo Using CXX compiler $CXX and C compiler $CC
|
|
|
|
|
2018-02-18 03:54:22 +01:00
|
|
|
# Setup target directory
|
|
|
|
mkdir cmake
|
|
|
|
cd cmake
|
|
|
|
cmake --version
|
|
|
|
|
|
|
|
# Build
|
2018-09-28 01:31:12 +02:00
|
|
|
echo Build target: ${BUILD_TARGET}
|
|
|
|
cmake .. -DBUILD_TESTING=on -DCMAKE_BUILD_TYPE=${BUILD_TARGET}
|
2018-02-18 03:54:22 +01:00
|
|
|
make -j$NUMCORES
|
|
|
|
|
2018-09-27 11:23:05 +02:00
|
|
|
ccache --show-stats
|
|
|
|
|
2018-02-18 03:54:22 +01:00
|
|
|
# Test
|
2020-07-11 01:23:55 +02:00
|
|
|
./test/gitversion/gitversion-test
|
|
|
|
./test/cpp-utils/cpp-utils-test
|
|
|
|
./test/parallelaccessstore/parallelaccessstore-test
|
|
|
|
./test/blockstore/blockstore-test
|
|
|
|
./test/blobstore/blobstore-test
|
|
|
|
./test/cryfs/cryfs-test
|
2018-02-18 03:54:22 +01:00
|
|
|
|
2018-09-27 11:25:56 +02:00
|
|
|
# TODO Also run once fixed
|
2020-07-11 01:23:55 +02:00
|
|
|
# ./test/fspp/fspp-test
|
|
|
|
# ./test/cryfs-cli/cryfs-cli-test
|