blob: 40e3fc7e768fe38331ddc24663288cf622ccf346 [file] [log] [blame]
Lei Zhangc4ebb552016-05-04 11:29:21 -04001# Linux and Mac Build Configuration for Travis
2
3language: cpp
4
5os:
6 - linux
7 - osx
8
9# Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
Lei Zhangb21213e2017-05-13 14:26:30 -040010sudo: false
Lei Zhangc4ebb552016-05-04 11:29:21 -040011dist: trusty
12
13env:
14 - GLSLANG_BUILD_TYPE=Release
15 - GLSLANG_BUILD_TYPE=Debug
16
17compiler:
18 - clang
19 - gcc
20
21matrix:
22 fast_finish: true # Show final status immediately if a test fails.
23 exclude:
24 # Skip GCC builds on Mac OS X.
25 - os: osx
26 compiler: gcc
Lei Zhangb21213e2017-05-13 14:26:30 -040027 include:
28 # Additional build using Android NDK.
29 - env: BUILD_NDK=ON
Lei Zhangc4ebb552016-05-04 11:29:21 -040030
31cache:
32 apt: true
33
34branches:
35 only:
36 - master
37
38addons:
39 apt:
40 packages:
41 - clang-3.6
42 - ninja-build
43
44install:
45 # Install ninja on Mac OS X.
46 - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew update && brew install ninja; fi
Lei Zhangb21213e2017-05-13 14:26:30 -040047 # Make sure that clang-3.6 is selected on Linux.
Lei Zhangc4ebb552016-05-04 11:29:21 -040048 - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "clang" ]]; then
49 export CC=clang-3.6 CXX=clang++-3.6;
50 fi
Lei Zhangb21213e2017-05-13 14:26:30 -040051 # Download Android NDK and Android CMake toolchain file.
52 - if [[ "$BUILD_NDK" == "ON" ]]; then
53 git clone --depth=1 https://github.com/urho3d/android-ndk.git $HOME/android-ndk;
54 export ANDROID_NDK=$HOME/android-ndk;
55 git clone --depth=1 https://github.com/taka-no-me/android-cmake.git $HOME/android-cmake;
56 export TOOLCHAIN_PATH=$HOME/android-cmake/android.toolchain.cmake;
57 fi
Lei Zhangc4ebb552016-05-04 11:29:21 -040058
59before_script:
60 - git clone https://github.com/google/googletest.git External/googletest
61
62script:
63 - mkdir build && cd build
Lei Zhangb21213e2017-05-13 14:26:30 -040064 # For Android, do release building using NDK without testing.
65 # For Linux and macOS, do debug/release building with testing.
66 - if [[ "$BUILD_NDK" == "ON" ]]; then
67 cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_PATH}
68 -DANDROID_NATIVE_API_LEVEL=android-12
69 -DCMAKE_BUILD_TYPE=Release
70 -DANDROID_ABI="armeabi-v7a with NEON"
71 -DBUILD_TESTING=OFF
72 -GNinja ..;
73 ninja;
74 else
75 cmake -DCMAKE_BUILD_TYPE=${GLSLANG_BUILD_TYPE}
76 -DCMAKE_INSTALL_PREFIX=`pwd`/install
77 -GNinja ..;
78 ninja install;
79 ctest --output-on-failure &&
80 cd ../Test && ./runtests;
81 fi