• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# 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.
10sudo: false
11dist: trusty
12
13env:
14  global:
15    - secure: aGFrgzyKp+84hKrGkxVWg8cHV61uqrKEHT38gfSQK6+WS4GfLOyH83p7WnsEBb7AMhzU7LMNFdvOFr6+NaMpVnqRvc40CEG1Q+lNg9Pq9mhIZLowvDrfqTL9kQ+8Nbw5Q6/dg6CTvY7fvRfpfCEmKIUZBRkoKUuHeuM1uy3IupFcdNuL5bSYn3Beo+apSJginh9DI4BLDXFUgBzTRSLLyCX5g3cpaeGGOCr8quJlYx75W6HRck5g9SZuLtUoH9GFEV3l+ZEWB8noErW+J56L03bwNwFuuAh321evw++oQk5KFa8rlDvar3SJ3b1RHB8u/eq5DBYMyaK/fS8+Q7QbGr8diF/wDe68bKO7U9IhpNfExXmczCpExjHomW5TQv4rYdGhygPMfW97aIsPRYyNKcl4fkmb7NDrM8w0Jscdq2g5c2Kz0ItyZoBri/NXLwFQQjaVCs7Pf97TjuMA7mK0GJmDTRzi6SrDYlWMt5BQL3y0CCojyfLIRcTh0CQjQI29s97bLfQrYAxt9GNNFR+HTXRLLrkaAlJkPGEPwUywlSfEThnvHLesNxYqemolAYpQT4ithoL4GehGIHmaxsW295aKVhuRf8K9eBODNqrfblvM42UHhjntT+92ZnQ/Gkq80GqaMxnxi4PO5FyPIxt0r981b54YBkWi8YA4P7w5pNI=
16  matrix:
17    - GLSLANG_BUILD_TYPE=Release
18    - GLSLANG_BUILD_TYPE=Debug
19
20compiler:
21  - clang
22  - gcc
23
24matrix:
25  fast_finish: true # Show final status immediately if a test fails.
26  exclude:
27    # Skip GCC builds on Mac OS X.
28    - os: osx
29      compiler: gcc
30  include:
31    # Additional build using Android NDK.
32    - env: BUILD_NDK=ON
33
34cache:
35  apt: true
36
37branches:
38  only:
39    - master
40
41addons:
42  apt:
43    packages:
44      - clang-3.6
45
46install:
47  # Make sure that clang-3.6 is selected on Linux.
48  - if [[ "$TRAVIS_OS_NAME" == "linux" && "$CC" == "clang" ]]; then
49      export CC=clang-3.6 CXX=clang++-3.6;
50    fi
51  # Download a recent Android NDK and use its android.toolchain.cmake file.
52  - if [[ "$BUILD_NDK" == "ON" ]]; then
53      export ANDROID_NDK=$HOME/android-ndk;
54      git init $ANDROID_NDK;
55      pushd $ANDROID_NDK;
56        git remote add dneto0 https://github.com/dneto0/android-ndk.git;
57        git fetch --depth=1 dneto0 r17b-strip;
58        git checkout FETCH_HEAD;
59      popd;
60      export TOOLCHAIN_PATH=$ANDROID_NDK/build/cmake/android.toolchain.cmake;
61    fi
62
63before_script:
64  - git clone --depth=1 https://github.com/google/googletest.git External/googletest
65  - ./update_glslang_sources.py
66
67script:
68  - mkdir build && cd build
69  # For Android, do release building using NDK without testing.
70  # Use android-14, the oldest native API level supporeted by NDK r17b.
71  # We can use newer API levels if we want.
72  # For Linux and macOS, do debug/release building with testing.
73  - if [[ "$BUILD_NDK" == "ON" ]]; then
74      cmake -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_PATH}
75            -DANDROID_NATIVE_API_LEVEL=android-14
76            -DCMAKE_BUILD_TYPE=Release
77            -DANDROID_ABI="armeabi-v7a with NEON"
78            -DBUILD_TESTING=OFF ..;
79      make -j4;
80    else
81      cmake -DCMAKE_BUILD_TYPE=${GLSLANG_BUILD_TYPE}
82            -DCMAKE_INSTALL_PREFIX=`pwd`/install ..;
83      make -j4 install;
84      ctest --output-on-failure &&
85      cd ../Test && ./runtests;
86    fi
87
88after_success:
89  # For debug build, the generated dll has a postfix "d" in its name.
90  - if [[ "${GLSLANG_BUILD_TYPE}" == "Debug" ]]; then
91      export SUFFIX="d";
92    else
93      export SUFFIX="";
94    fi
95  # Create tarball for deployment
96  - if [[ ${CC} == clang* && "${BUILD_NDK}" != "ON" ]]; then
97      cd ../build/install;
98      export TARBALL=glslang-master-${TRAVIS_OS_NAME}-${GLSLANG_BUILD_TYPE}.zip;
99      zip ${TARBALL}
100        bin/glslangValidator
101        include/glslang/*
102        include/SPIRV/*
103        lib/libglslang${SUFFIX}.a
104        lib/libHLSL${SUFFIX}.a
105        lib/libOGLCompiler${SUFFIX}.a
106        lib/libOSDependent${SUFFIX}.a
107        lib/libSPIRV${SUFFIX}.a
108        lib/libSPVRemapper${SUFFIX}.a
109        lib/libSPIRV-Tools${SUFFIX}.a
110        lib/libSPIRV-Tools-opt${SUFFIX}.a;
111    fi
112
113before_deploy:
114  # Tag the current top of the tree as "master-tot".
115  # Travis CI replies on the tag name to properly push to GitHub Releases.
116  - git config --global user.name "Travis CI"
117  - git config --global user.email "builds@travis-ci.org"
118  - git tag -f master-tot
119  - git push -q -f https://${glslangtoken}@github.com/KhronosGroup/glslang --tags
120
121deploy:
122  provider: releases
123  api_key: ${glslangtoken}
124  on:
125    branch: master
126    condition: ${CC} == clang* && ${BUILD_NDK} != ON
127  file: ${TARBALL}
128  skip_cleanup: true
129  overwrite: true
130