Skip to content

Commit da49859

Browse files
committed
In travis-ci, build for osx also
Drop gcc b/c it takes too long to install via addon. Build only static/release, to save VMs. (No shared to debug.)
1 parent 7452872 commit da49859

6 files changed

+61
-39
lines changed

Diff for: .travis.yml

+22-39
Original file line numberDiff line numberDiff line change
@@ -1,59 +1,42 @@
1-
# Build matrix / environment variable are explained on:
1+
# Build matrix / environment variables are explained on:
22
# http://about.travis-ci.org/docs/user/build-configuration/
33
# This file can be validated on:
44
# http://lint.travis-ci.org/
55
# See also
66
# http://stackoverflow.com/questions/22111549/travis-ci-with-clang-3-4-and-c11/30925448#30925448
77
# to allow C++11, though we are not yet building with -std=c++11
88

9-
#before_install: pyenv install 3.5.4 && pyenv global 3.5.4
10-
before_install: pyenv global 3.6
11-
# https://docs.travis-ci.com/user/languages/python/
12-
# "for Trusty, this means 2.7.6 and 3.4.3"
9+
before_install:
10+
- source travis.before_install.${TRAVIS_OS_NAME}.sh
1311
install:
14-
- if [[ $TRAVIS_OS_NAME == osx ]]; then
15-
brew update;
16-
brew install python3 ninja;
17-
python3 -m venv venv;
18-
source venv/bin/activate;
19-
elif [[ $TRAVIS_OS_NAME == linux ]]; then
20-
wget https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip;
21-
unzip -q ninja-linux.zip -d build;
22-
fi
23-
- pip3 install meson
24-
# /usr/bin/gcc is 4.6 always, but gcc-X.Y is available.
25-
- if [[ $CXX = g++ ]]; then export CXX="g++-4.9" CC="gcc-4.9"; fi
26-
# /usr/bin/clang has a conflict with gcc, so use clang-X.Y.
27-
- if [[ $CXX = clang++ ]]; then export CXX="clang++-3.5" CC="clang-3.5"; fi
28-
- echo ${PATH}
29-
- ls /usr/local
30-
- ls /usr/local/bin
31-
- export PATH="${PWD}"/build:/usr/local/bin:/usr/bin:${PATH}
32-
- echo ${CXX}
33-
- ${CXX} --version
34-
- which valgrind
12+
- source travis.install.${TRAVIS_OS_NAME}.sh
3513
addons:
3614
apt:
3715
sources:
38-
- ubuntu-toolchain-r-test
16+
#- ubuntu-toolchain-r-test
3917
- llvm-toolchain-precise-3.5
4018
packages:
41-
- gcc-4.9
42-
- g++-4.9
19+
#- gcc-4.9
20+
#- g++-4.9
4321
- clang-3.5
4422
- valgrind
45-
os:
46-
- linux
4723
language: cpp
48-
compiler:
49-
- gcc
50-
- clang
5124
script: ./travis.sh
52-
env:
53-
matrix:
54-
- LIB_TYPE=static BUILD_TYPE=release
55-
- LIB_TYPE=shared BUILD_TYPE=debug
25+
matrix:
26+
allow_failures:
27+
- os: osx
28+
matrix:
29+
include:
30+
- os: osx
31+
osx_image: xcode9.4
32+
compiler: clang
33+
#env: PYENV_ROOT=/usr/local/var/pyenv
34+
env: LIB_TYPE=static BUILD_TYPE=release
35+
#- LIB_TYPE=shared BUILD_TYPE=debug
36+
- os: linux
37+
dist: trusty
38+
compiler: clang
39+
env: LIB_TYPE=static BUILD_TYPE=release
5640
notifications:
5741
email: false
58-
dist: trusty
5942
sudo: false

Diff for: travis.before_install.linux.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
set -vex
2+
#before_install: pyenv install 3.5.4 && pyenv global 3.5.4
3+
#before_install: pyenv global 3.6
4+
# https://docs.travis-ci.com/user/languages/python/
5+
# "for Trusty, this means 2.7.6 and 3.4.3"
6+
7+
pyenv global 3.6

Diff for: travis.before_install.osx.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
set -vex
2+
#brew install pyenv
3+
#which pyenv

Diff for: travis.install.linux.sh

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
set -vex
2+
3+
wget https://github.com/ninja-build/ninja/releases/download/v1.7.2/ninja-linux.zip
4+
unzip -q ninja-linux.zip -d build
5+
6+
pip3 install meson
7+
# /usr/bin/gcc is 4.6 always, but gcc-X.Y is available.
8+
if [[ $CXX = g++ ]]; then export CXX="g++-4.9" CC="gcc-4.9"; fi
9+
# /usr/bin/clang has a conflict with gcc, so use clang-X.Y.
10+
if [[ $CXX = clang++ ]]; then export CXX="clang++-3.5" CC="clang-3.5"; fi
11+
echo ${PATH}
12+
ls /usr/local
13+
ls /usr/local/bin
14+
export PATH="${PWD}"/build:/usr/local/bin:/usr/bin:${PATH}

Diff for: travis.install.osx.sh

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
set -vex
2+
3+
#brew update
4+
brew upgrade python3
5+
python3 -m venv venv
6+
source venv/bin/activate
7+
8+
brew install ninja
9+
brew install meson
10+
11+
#brew install pyenv
12+
#which pyenv

Diff for: travis.sh

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ set -vex
1717

1818
env | sort
1919

20+
echo ${CXX}
21+
${CXX} --version
22+
python3 --version
2023
meson --version
2124
ninja --version
2225
meson --buildtype ${BUILD_TYPE} --default-library ${LIB_TYPE} . build-${LIB_TYPE}

0 commit comments

Comments
 (0)