From d02bf257a654f3a8fdcafbb33640e993f48ed177 Mon Sep 17 00:00:00 2001 From: mayeut Date: Sun, 11 Oct 2015 17:10:48 +0200 Subject: [PATCH] Find out Visual Studio version --- tools/travis-ci/run.sh | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/tools/travis-ci/run.sh b/tools/travis-ci/run.sh index 6b5a9949..7d6bd141 100755 --- a/tools/travis-ci/run.sh +++ b/tools/travis-ci/run.sh @@ -68,7 +68,7 @@ if [ "${TRAVIS_OS_NAME:-}" == "" ]; then fi elif uname -s | grep -i CYGWIN &> /dev/null; then TRAVIS_OS_NAME=windows - elif uname -s | grep -i MINGW32 &> /dev/null; then + elif uname -s | grep -i MINGW &> /dev/null; then TRAVIS_OS_NAME=windows else echo "Failed to guess OS"; exit 1 @@ -101,7 +101,24 @@ elif [ "${TRAVIS_OS_NAME}" == "linux" ]; then fi elif [ "${TRAVIS_OS_NAME}" == "windows" ]; then OPJ_OS_NAME=windows - OPJ_CC_VERSION=vs2015 + if which cl > /dev/null; then + OPJ_CL_VERSION=$(cl 2>&1 | grep Version | sed 's/.*Version \([0-9]*\).*/\1/') + if [ ${OPJ_CL_VERSION} -eq 19 ]; then + OPJ_CC_VERSION=vs2015 + elif [ ${OPJ_CL_VERSION} -eq 18 ]; then + OPJ_CC_VERSION=vs2013 + elif [ ${OPJ_CL_VERSION} -eq 17 ]; then + OPJ_CC_VERSION=vs2012 + elif [ ${OPJ_CL_VERSION} -eq 16 ]; then + OPJ_CC_VERSION=vs2010 + elif [ ${OPJ_CL_VERSION} -eq 15 ]; then + OPJ_CC_VERSION=vs2008 + elif [ ${OPJ_CL_VERSION} -eq 14 ]; then + OPJ_CC_VERSION=vs2005 + else + OPJ_CC_VERSION=vs???? + fi + fi else echo "OS not supported: ${TRAVIS_OS_NAME}"; exit 1 fi