Integrate OS X .travis.yml into master branch using multi-os feature.
http://docs.travis-ci.com/user/multi-os/ Expand testflags.py to support clang vs gcc, as clang is used on OS X.
This commit is contained in:
parent
567d4690cf
commit
9155ff0fbb
4 changed files with 227 additions and 33 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
def get_cflags(language, std):
|
||||
def get_cflags(language, std, compiler):
|
||||
if std == None or len(std) == 0:
|
||||
std = "gnu89"
|
||||
c_common = "-fdiagnostics-show-option -std=" + std + " -Wno-long-long -Wreturn-type -Wdeclaration-after-statement"
|
||||
|
|
@ -20,13 +20,15 @@ def get_cflags(language, std):
|
|||
"scilab":"-Werror " + c_common,
|
||||
"tcl":"-Werror " + c_common,
|
||||
}
|
||||
if compiler == 'clang':
|
||||
cflags["guile"] += " -Wno-attributes" # -Wno-attributes is for clang LLVM 3.5 and bdw-gc < 7.5 used by guile
|
||||
|
||||
if language not in cflags:
|
||||
raise RuntimeError("{} is not a supported language".format(language))
|
||||
|
||||
return cflags[language]
|
||||
|
||||
def get_cxxflags(language, std):
|
||||
def get_cxxflags(language, std, compiler):
|
||||
if std == None or len(std) == 0:
|
||||
std = "c++98"
|
||||
cxx_common = "-fdiagnostics-show-option -std=" + std + " -Wno-long-long -Wreturn-type"
|
||||
|
|
@ -46,6 +48,8 @@ def get_cxxflags(language, std):
|
|||
"scilab": cxx_common,
|
||||
"tcl":"-Werror " + cxx_common,
|
||||
}
|
||||
if compiler == 'clang':
|
||||
cxxflags["guile"] += " -Wno-attributes" # -Wno-attributes is for clang LLVM 3.5 and bdw-gc < 7.5 used by guile
|
||||
|
||||
if language not in cxxflags:
|
||||
raise RuntimeError("{} is not a supported language".format(language))
|
||||
|
|
@ -59,12 +63,15 @@ flags = parser.add_mutually_exclusive_group(required=True)
|
|||
flags.add_argument('-c', '--cflags', action='store_true', default=False, help='show CFLAGS')
|
||||
flags.add_argument('-x', '--cxxflags', action='store_true', default=False, help='show CXXFLAGS')
|
||||
parser.add_argument('-s', '--std', required=False, help='language standard flags for the -std= option')
|
||||
parser.add_argument('-C', '--compiler', required=False, help='compiler used (clang or gcc)')
|
||||
args = parser.parse_args()
|
||||
|
||||
if args.cflags:
|
||||
print("{}".format(get_cflags(args.language, args.std)))
|
||||
get_flags = get_cflags
|
||||
elif args.cxxflags:
|
||||
print("{}".format(get_cxxflags(args.language, args.std)))
|
||||
get_flags = get_cxxflags
|
||||
else:
|
||||
parser.print_help()
|
||||
exit(1)
|
||||
|
||||
print(get_flags(args.language, args.std, args.compiler))
|
||||
|
|
|
|||
97
Tools/travis-linux-install.sh
Normal file
97
Tools/travis-linux-install.sh
Normal file
|
|
@ -0,0 +1,97 @@
|
|||
#!/bin/bash
|
||||
lsb_release -a
|
||||
sudo apt-get -qq update
|
||||
|
||||
if [[ "$GCC5" ]]; then
|
||||
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
|
||||
sudo add-apt-repository -y ppa:boost-latest/ppa
|
||||
sudo apt-get -qq update
|
||||
sudo apt-get install -qq g++-5 libboost1.55-dev
|
||||
export CC=gcc-5 CXX=g++-5
|
||||
else
|
||||
sudo apt-get -qq install libboost-dev
|
||||
fi
|
||||
|
||||
case "$SWIGLANG" in
|
||||
"")
|
||||
sudo apt-get -qq install yodl
|
||||
;;
|
||||
"csharp")
|
||||
sudo apt-get -qq install mono-devel
|
||||
;;
|
||||
"d")
|
||||
wget http://downloads.dlang.org/releases/2014/dmd_2.066.0-0_amd64.deb
|
||||
sudo dpkg -i dmd_2.066.0-0_amd64.deb
|
||||
;;
|
||||
"go")
|
||||
# Until configure.ac is fixed
|
||||
go env | sed -e 's/^/export /' > goenvsetup
|
||||
source goenvsetup
|
||||
rm -f goenvsetup
|
||||
;;
|
||||
"javascript")
|
||||
case "$ENGINE" in
|
||||
"node")
|
||||
sudo add-apt-repository -y ppa:chris-lea/node.js
|
||||
sudo apt-get -qq update
|
||||
sudo apt-get install -qq nodejs rlwrap
|
||||
sudo npm install -g node-gyp
|
||||
;;
|
||||
"jsc")
|
||||
sudo apt-get install -qq libwebkitgtk-dev
|
||||
;;
|
||||
"v8")
|
||||
sudo apt-get install -qq libv8-dev
|
||||
;;
|
||||
esac
|
||||
;;
|
||||
"guile")
|
||||
sudo apt-get -qq install guile-2.0-dev
|
||||
;;
|
||||
"lua")
|
||||
sudo apt-get -qq install lua5.1 liblua5.1-dev
|
||||
;;
|
||||
"ocaml")
|
||||
# configure also looks for ocamldlgen, but this isn't packaged. But it isn't used by default so this doesn't matter.
|
||||
sudo apt-get -qq install ocaml ocaml-findlib
|
||||
;;
|
||||
"octave")
|
||||
if [[ -z "$VER" ]]; then
|
||||
sudo apt-get -qq install octave3.2 octave3.2-headers
|
||||
else
|
||||
sudo add-apt-repository -y ppa:kwwette/octaves
|
||||
sudo apt-get -qq update
|
||||
sudo apt-get -qq install liboctave${VER}-dev
|
||||
fi
|
||||
;;
|
||||
"php")
|
||||
sudo apt-get install php5-cli php5-dev
|
||||
;;
|
||||
"python")
|
||||
git clone https://github.com/jcrocholl/pep8.git
|
||||
(
|
||||
cd pep8
|
||||
git checkout tags/1.5.7
|
||||
python ./setup.py build
|
||||
sudo python ./setup.py install
|
||||
)
|
||||
if [[ "$PY3" ]]; then
|
||||
sudo apt-get install -qq python3-dev
|
||||
fi
|
||||
if [[ "$VER" ]]; then
|
||||
sudo add-apt-repository -y ppa:fkrull/deadsnakes
|
||||
sudo apt-get -qq update
|
||||
sudo apt-get -qq install python${VER}-dev
|
||||
CONFIGOPTS+=("--with-python${PY3}=python${VER}");
|
||||
fi
|
||||
;;
|
||||
"r")
|
||||
sudo apt-get -qq install r-base
|
||||
;;
|
||||
"scilab")
|
||||
sudo apt-get -qq install scilab
|
||||
;;
|
||||
"tcl")
|
||||
sudo apt-get -qq install tcl8.4-dev
|
||||
;;
|
||||
esac
|
||||
23
Tools/travis-osx-install.sh
Normal file
23
Tools/travis-osx-install.sh
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
#!/bin/bash
|
||||
sw_vers
|
||||
brew update
|
||||
brew list
|
||||
brew install pcre
|
||||
# brew install boost
|
||||
case "$SWIGLANG" in
|
||||
"csharp")
|
||||
brew install https://s3.amazonaws.com/travisbuilds.swig.org/mono.rb
|
||||
;;
|
||||
"guile")
|
||||
Tools/brew-install guile
|
||||
;;
|
||||
"lua")
|
||||
brew install lua
|
||||
;;
|
||||
"python")
|
||||
if [[ "$PY3" ]]; then
|
||||
brew install python3
|
||||
brew list -v python3
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
Loading…
Add table
Add a link
Reference in a new issue