Add cmake and clang build to travis

This commit is contained in:
seelabs
2016-06-17 11:10:33 -04:00
committed by Vinnie Falco
parent ef2330d477
commit 42557b800c
3 changed files with 71 additions and 31 deletions

View File

@@ -37,8 +37,8 @@ elif [[ $(uname -s) == "Linux" ]]; then
num_proc_units=$(nproc)
# Physical cores
num_jobs=$(lscpu -p | grep -v '^#' | sort -u -t, -k 2,4 | wc -l)
if (("$num_proc_units" < "$num_jobs")); then
num_jobs=$num_proc_units
if ((${num_proc_units} < ${num_jobs})); then
num_jobs=$num_proc_units
fi
fi
@@ -82,6 +82,16 @@ function build_beast {
-j${num_jobs}
}
function build_beast_cmake {
mkdir -p build
pushd build > /dev/null
cmake -DCMAKE_BUILD_TYPE=${VARIANT^} ..
make -j${num_jobs}
mkdir -p ../bin/$VARIANT
find . -executable -type f -exec cp {} ../bin/$VARIANT/. \;
popd > /dev/null
}
function run_autobahn_test_suite {
# Run autobahn tests
wsecho=$(find bin -name "websocket-echo" | grep /$VARIANT/)
@@ -108,7 +118,11 @@ function run_autobahn_test_suite {
##################################### BUILD ####################################
build_beast
if [[ ${BUILD_SYSTEM:-} == cmake ]]; then
build_beast_cmake
else
build_beast
fi
##################################### TESTS ####################################

View File

@@ -12,11 +12,32 @@ do
test -x $( type -p ${g}-$GCC_VER )
ln -sv $(type -p ${g}-$GCC_VER) $HOME/bin/${g}
done
for c in clang clang++ llvm-symbolizer
do
test -x $( type -p ${c}-$CLANG_VER )
ln -sv $(type -p ${c}-$CLANG_VER) $HOME/bin/${c}
done
if [[ -n ${CLANG_VER:-} ]]; then
# There are cases where the directory exists, but the exe is not available.
# Use this workaround for now.
if [[ ! -x llvm-${LLVM_VERSION}/bin/llvm-config ]] && [[ -d llvm-${LLVM_VERSION} ]]; then
rm -fr llvm-${LLVM_VERSION}
fi
if [[ ! -d llvm-${LLVM_VERSION} ]]; then
mkdir llvm-${LLVM_VERSION}
LLVM_URL="http://llvm.org/releases/${LLVM_VERSION}/clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-14.04.tar.xz"
wget -O - ${LLVM_URL} | tar -Jxvf - --strip 1 -C llvm-${LLVM_VERSION}
fi
llvm-${LLVM_VERSION}/bin/llvm-config --version;
export LLVM_CONFIG="llvm-${LLVM_VERSION}/bin/llvm-config";
fi
# There are cases where the directory exists, but the exe is not available.
# Use this workaround for now.
if [[ ! -x cmake/bin/cmake && -d cmake ]]; then
rm -fr cmake
fi
if [[ ! -d cmake && ${BUILD_SYSTEM:-} == cmake ]]; then
CMAKE_URL="http://www.cmake.org/files/v3.5/cmake-3.5.2-Linux-x86_64.tar.gz"
mkdir cmake && wget --no-check-certificate -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C cmake
fi
# NOTE, changed from PWD -> HOME
export PATH=$HOME/bin:$PATH