Skip to content

Commit f6ea1dc

Browse files
author
ayla
committed
Enable travis-ci OS X builds.
1 parent 122df62 commit f6ea1dc

5 files changed

+37
-7
lines changed

.travis.yml

+21-7
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
language: cpp
1+
language:
2+
- cpp
3+
4+
os:
5+
- osx
6+
- linux
7+
28
compiler:
3-
- gcc
49
- clang
10+
11+
# check environment (copied from libgit2sharp)
512
before_install:
6-
- sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
7-
- sudo apt-get update -qq
8-
- sudo apt-get install -qq cmake
9-
- if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8; fi
10-
- if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
13+
- date -u
14+
- uname -a
15+
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./ci/linux_before_install.sh; fi
16+
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ./ci/osx_before_install.sh; fi
17+
18+
# make sure cmake is installed, set up latest GCC C++ compiler if necessary
19+
install:
20+
- if [ "${TRAVIS_OS_NAME}" = "linux" ]; then ./ci/linux_install.sh; fi
21+
# - if [ "${TRAVIS_OS_NAME}" = "linux" -a "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi
22+
- if [ "${TRAVIS_OS_NAME}" = "osx" ]; then ./ci/osx_install.sh; fi
23+
24+
# TODO: could move script to separate file
1125
script: mkdir build && cd build && cmake .. && make

ci/linux_before_install.sh

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env bash
2+
3+
sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
4+
sudo apt-get update -qq

ci/linux_install.sh

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
3+
sudo apt-get install -qq cmake
4+
echo "$CXX"
5+
if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.8; fi
6+
if [ "$CXX" = "g++" ]; then export CXX="g++-4.8" CC="gcc-4.8"; fi

ci/osx_before_install.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
brew update

ci/osx_install.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/usr/bin/env bash
2+
3+
which cmake || brew install cmake

0 commit comments

Comments
 (0)