sol2/install.deps.sh
Kevin Brightwell 15e91f811f Add build/test support for Travis CI
Tests:

 OS    | Compiler  | Lua Version
 :---- | --------- | -----------
 Linux | gcc-4.9   | lua52, LuaJIT
 Linux | gcc-5     | lua52, LuaJIT
 Linux | clang-3.6 | lua52, LuaJIT
 OSX   | xcode6    | lua52
 OSX   | xcode7    | lua52
 OSX   | gcc-4.9*  | lua52
 OSX   | gcc-5     | lua52

\* On OSX out of the box, gcc-4.9 is actually the gcc wrapper around appleclang
2016-02-24 18:41:23 -05:00

83 lines
1.7 KiB
Bash

#!/usr/bin/env bash
# This script installs and configures the dependencies for the project
case `uname` in
Darwin) export OS_NAME="osx" ;;
Linux) export OS_NAME="linux" ;;
esac
echo "Building on: ${OS_NAME}"
if env | grep -qE '^(?:TRAVIS|CI)='; then
# We're on Travis, intialize variables:
echo "Detected CI Build -> CI=${CI}"
else
# We're building locally
export CI=false
echo "Detected Local Build -> CI=${CI}"
fi
export_compiler_vars() {
case ${COMPILER} in
appleclang*)
export CC=clang
export CXX=clang++
;;
clang*)
export CC=$(echo ${COMPILER} | sed 's/\+//g')
export CXX=${COMPILER}
;;
g++-*)
export CC=$(echo ${COMPILER} | sed 's/\+/c/g')
export CXX=${COMPILER}
;;
*) echo "Invalid compiler version" ; exit 2 ;;
esac
echo "CC=${CC}"
$CC --version
echo "CXX=${CXX}"
$CXX --version
}
install_os_deps() {
# Install all of the OS specific OS dependencies
echo "Install: os-based dependencies"
local wd=`pwd`
case ${OS_NAME} in
osx)
export HOMEBREW_NO_EMOJI=1
echo "brew update ..."; brew update > /dev/null
case ${COMPILER} in
appleclang*) ;;
g++-5)
brew install gcc5
brew link gcc5 --overwrite --force
;;
g++-4.9) ;;
*) echo "Invalid compiler version" ; exit 2 ;;
esac
brew install ninja lua
;;
linux)
# no extras currently
;;
esac
cd ${wd}
}