summaryrefslogtreecommitdiff
path: root/.travis/cmake-osx
diff options
context:
space:
mode:
authoriphydf <iphydf@users.noreply.github.com>2018-06-24 22:56:07 +0000
committeriphydf <iphydf@users.noreply.github.com>2018-07-01 08:35:44 +0000
commit1a54be06cd359257478b584611f34058d21fe723 (patch)
treedb3d6ca2dfa2a87ae2efdac6e412c2b780a64009 /.travis/cmake-osx
parent706fad1ce88c2104009a3835ee343ff9d8ec8b79 (diff)
Simplify Travis CI builds.
Have one script per build. This means more duplication between the scripts, but it's much easier to understand and to run locally.
Diffstat (limited to '.travis/cmake-osx')
-rwxr-xr-x.travis/cmake-osx46
1 files changed, 46 insertions, 0 deletions
diff --git a/.travis/cmake-osx b/.travis/cmake-osx
new file mode 100755
index 00000000..529a2309
--- /dev/null
+++ b/.travis/cmake-osx
@@ -0,0 +1,46 @@
1#!/bin/sh
2
3ACTION="$1"
4
5set -eu
6
7CACHEDIR="$HOME/cache"
8NPROC=`sysctl -n hw.physicalcpu`
9
10travis_install() {
11 # Workaround for bug in Homebrew where it only finds an old Ruby version.
12 brew update
13
14 brew install libsodium libvpx opus libconfig
15}
16
17travis_script() {
18 . ".travis/flags-$CC.sh"
19
20 add_ld_flag -undefined error
21
22 # Make compilation error on a warning
23 add_flag -Werror
24
25 cmake -B_build -H. \
26 -DCMAKE_C_FLAGS="$C_FLAGS" \
27 -DCMAKE_CXX_FLAGS="$CXX_FLAGS" \
28 -DCMAKE_EXE_LINKER_FLAGS="$LD_FLAGS" \
29 -DCMAKE_SHARED_LINKER_FLAGS="$LD_FLAGS" \
30 -DCMAKE_INSTALL_PREFIX:PATH="$PWD/_install" \
31 -DTRACE=ON \
32 -DMUST_BUILD_TOXAV=ON \
33 -DTEST_TIMEOUT_SECONDS=120 \
34 -DUSE_IPV6=OFF
35
36 cd _build # pushd
37 make "-j$NPROC" -k install
38 make "-j$NPROC" test ARGS="-j50" CTEST_OUTPUT_ON_FAILURE=1
39 cd - # popd
40}
41
42if [ "-z" "$ACTION" ]; then
43 "travis_script"
44else
45 "travis_$ACTION"
46fi