2016-06-28 21:53:08 +02:00
|
|
|
#!/bin/bash
|
2016-07-13 16:20:15 +02:00
|
|
|
|
|
|
|
# for executing in non travis environment
|
|
|
|
|
2016-08-28 15:10:43 +02:00
|
|
|
[ -z "$TRAVIS_OS_NAME" ] && TRAVIS_OS_NAME="$(uname -s | tr 'A-Z' 'a-z')"
|
2016-07-13 16:20:15 +02:00
|
|
|
|
2016-08-28 15:10:43 +02:00
|
|
|
# Detect number of processor cores
|
2016-07-13 16:20:15 +02:00
|
|
|
|
2016-08-28 15:10:43 +02:00
|
|
|
if [[ $TRAVIS_OS_NAME == 'osx' || $TRAVIS_OS_NAME == 'darwin' ]]; then
|
2016-08-11 07:13:55 +02:00
|
|
|
procs=$(sysctl -n hw.ncpu | xargs)
|
2016-08-28 15:10:43 +02:00
|
|
|
elif [[ $TRAVIS_OS_NAME == 'linux' ]]; then
|
|
|
|
procs=$(nproc)
|
|
|
|
else
|
|
|
|
# For most modern systems, including the pi, this is a sane default
|
|
|
|
procs=4
|
2016-06-28 21:53:08 +02:00
|
|
|
fi
|
|
|
|
|
2016-08-28 15:10:43 +02:00
|
|
|
|
|
|
|
# Compile hyperion
|
|
|
|
|
|
|
|
mkdir build || exit 1
|
|
|
|
cd build
|
|
|
|
cmake -DPLATFORM=x86-dev -DCMAKE_BUILD_TYPE=Debug .. || exit 2
|
|
|
|
make -j$(nproc) || exit 3
|
|
|
|
|
|
|
|
|
|
|
|
# Build the package on Linux
|
|
|
|
|
|
|
|
if [[ $TRAVIS_OS_NAME == 'linux' ]]; then
|
|
|
|
make -j$(nproc) package || exit 4
|
2016-06-28 21:53:08 +02:00
|
|
|
fi
|
2016-07-13 16:20:15 +02:00
|
|
|
|