Add SPIRV_SPIRV_COMPRESSION option to cmake
[platform/upstream/SPIRV-Tools.git] / .travis.yml
1 # Linux Build Configuration for Travis
2
3 language: cpp
4
5 os:
6   - linux
7   - osx
8
9 # Use Ubuntu 14.04 LTS (Trusty) as the Linux testing environment.
10 dist: trusty
11 sudo: false
12
13 # Use the default Xcode environment for Xcode.
14
15 env:
16   # Each line is a set of environment variables set before a build.
17   # Thus each line represents a different build configuration.
18   - BUILD_TYPE=Release
19   - BUILD_TYPE=Debug
20
21 compiler:
22   - clang
23   - gcc
24
25 matrix:
26   fast_finish: true
27   include:
28     # Additional build using Android NDK
29     - env: BUILD_NDK=ON
30   exclude:
31     # Skip GCC builds on macOS.
32     - os: osx
33       compiler: gcc
34
35 cache:
36   apt: true
37
38 git:
39   depth: 1
40
41 branches:
42   only:
43     - master
44
45 before_install:
46   - if [[ "$BUILD_NDK" == "ON" ]]; then
47       git clone --depth=1 https://github.com/urho3d/android-ndk.git $HOME/android-ndk;
48       export ANDROID_NDK=$HOME/android-ndk;
49       git clone --depth=1 https://github.com/taka-no-me/android-cmake.git $HOME/android-cmake;
50       export TOOLCHAIN_PATH=$HOME/android-cmake/android.toolchain.cmake;
51     fi
52
53 before_script:
54   - git clone --depth=1 https://github.com/KhronosGroup/SPIRV-Headers external/spirv-headers
55   - git clone --depth=1 https://github.com/google/googletest          external/googletest
56
57 script:
58   - mkdir build && cd build
59   - if [[ "$BUILD_NDK" == "ON" ]]; then
60       cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_PATH}
61             -DANDROID_NATIVE_API_LEVEL=android-9
62             -DCMAKE_BUILD_TYPE=Release
63             -DANDROID_ABI="armeabi-v7a with NEON"
64             -DSPIRV_BUILD_COMPRESSION=ON
65             -DSPIRV_SKIP_TESTS=ON ..;
66     else
67       cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} -DSPIRV_BUILD_COMPRESSION=ON ..;
68     fi
69   # Due to the limitation of Travis platform, we cannot start too many concurrent jobs.
70   # Otherwise GCC will panic with internal error, possibility because of memory issues.
71   - make -j4
72   - if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
73       export NPROC=`nproc`;
74     else
75       export NPROC=`sysctl -n hw.ncpu`;
76     fi
77   - if [[ "$BUILD_NDK" != "ON" ]]; then ctest -j${NPROC} --output-on-failure --timeout 300; fi
78
79
80 notifications:
81   email:
82     recipients:
83       - antiagainst@google.com
84       - awoloszyn@google.com
85       - dneto@google.com
86       - ehsann@google.com
87       - qining@google.com
88     on_success: change
89     on_failure: always