Browse Source

simplify CC and CXX setting as proposed in travis ci documentation

https://docs.travis-ci.com/user/languages/cpp/#gcc-on-linux
Alexei Pastuchov 6 years ago
parent
commit
f1d4c94fee
2 changed files with 7 additions and 7 deletions
  1. 6 2
      .travis.yml
  2. 1 5
      scripts/travis-linux.sh

+ 6 - 2
.travis.yml

@@ -15,7 +15,8 @@ matrix:
             - gcc-4.9
             - g++-4.9
         artifacts: true
-      env: COMPILER=g++-4.9
+      env:
+        - MATRIX_EVAL="CC=gcc-4.9 && CXX=g++-4.9"
     - compiler: gcc
       addons:
         apt:
@@ -25,9 +26,12 @@ matrix:
             - gcc-5
             - g++-5
         artifacts: true
-      env: COMPILER=g++-5
+      env:
+        - MATRIX_EVAL="CC=gcc-5 && CXX=g++-5"
+
 
 before_install:
+  - eval "${MATRIX_EVAL}"
   - . scripts/travis-$TRAVIS_OS_NAME.sh
 
 script:

+ 1 - 5
scripts/travis-linux.sh

@@ -1,7 +1,3 @@
 sudo apt-get update -qq
-COMPILER_PACKAGE=""
-if [ "$COMPILER" = "g++-4.9" ]; then COMPILER_PACKAGE=g++-4.9
-elif [ "$COMPILER" = "g++-5" ]; then COMPILER_PACKAGE=g++-5; fi
+COMPILER_PACKAGE=$CXX
 sudo apt-get install -y libboost-all-dev gperf libevent-dev uuid-dev python-sphinx libhiredis-dev $COMPILER_PACKAGE
-if [ "$COMPILER" = "g++-4.9" ]; then export CXX="g++-4.9" CC="gcc-4.9"
-elif [ "$COMPILER" = "g++-5" ]; then export CXX="g++-5" CC="gcc-5"; fi