From f422fe49f8b2f07bec6e4fcd9950fd15ac9bb7f3 Mon Sep 17 00:00:00 2001 From: "Alexander \"Ace\" Olofsson" Date: Thu, 24 Dec 2015 18:27:57 +0100 Subject: [PATCH] Slight improvement to the build setup --- CI/before_script.msvc.sh | 121 ++++++++++++++++++++++++++++----------- appveyor.yml | 3 +- 2 files changed, 91 insertions(+), 33 deletions(-) mode change 100644 => 100755 CI/before_script.msvc.sh diff --git a/CI/before_script.msvc.sh b/CI/before_script.msvc.sh old mode 100644 new mode 100755 index 51734ceb3..5aa8d3e9d --- a/CI/before_script.msvc.sh +++ b/CI/before_script.msvc.sh @@ -1,42 +1,86 @@ #!/bin/bash while [ $# -gt 0 ]; do - ARG=$1 + ARGSTR=$1 shift - case $ARG in - -v ) - VERBOSE=true ;; - - -d ) - SKIP_DOWNLOAD=true ;; - - -e ) - SKIP_EXTRACT=true ;; - - -k ) - KEEP=true ;; - - -u ) - UNITY_BUILD=true ;; - - -p ) - PLATFORM=$1 - shift ;; - - -c ) - CONFIGURATION=$1 - shift ;; + if [ ${ARGSTR:0:1} != "-" ]; then + echo "Unknown argument $ARGSTR" + echo "Try '$0 -h'" + exit 1 + fi - * ) - echo "Unknown arg $ARG." - exit 1 ;; - esac + for (( i=1; i<${#ARGSTR}; i++ )); do + ARG=${ARGSTR:$i:1} + case $ARG in + V ) + VERBOSE=true ;; + + v ) + VS_VERSION=$1 + shift ;; + + d ) + SKIP_DOWNLOAD=true ;; + + e ) + SKIP_EXTRACT=true ;; + + k ) + KEEP=true ;; + + u ) + UNITY_BUILD=true ;; + + p ) + PLATFORM=$1 + shift ;; + + c ) + CONFIGURATION=$1 + shift ;; + + h ) + cat < + Set the configuration, can also be set with environment variable CONFIGURATION. + -d + Skip checking the downloads. + -e + Skip extracting dependencies. + -h + Show this message. + -k + Keep the old build directory, default is to delete it. + -p + Set the build platform, can also be set with environment variable PLATFORM. + -u + Configure for unity builds. + -v <2013/2015> + Choose the Visual Studio version to use. + -V + Run verbosely +EOF + exit 0 + ;; + + * ) + echo "Unknown argument $ARG." + echo "Try '$0 -h'" + exit 1 ;; + esac + done done if [ -z $VERBOSE ]; then STRIP="> /dev/null 2>&1" fi +if [ -z $VS_VERSION ]; then + VS_VERSION="2013" +fi if [ -z $APPVEYOR ]; then echo "Running prebuild outside of Appveyor." @@ -148,14 +192,27 @@ if [ -z $CONFIGURATION ]; then CONFIGURATION="Debug" fi +case $VS_VERSION in + 14|2015 ) + GENERATOR="Visual Studio 14 2015" + XP_TOOLSET="v140_xp" + ;; + +# 12|2013| + * ) + GENERATOR="Visual Studio 12 2013" + XP_TOOLSET="v120_xp" + ;; +esac + case $PLATFORM in x64|x86_64|x86-64|win64|Win64 ) ARCHNAME=x86-64 ARCHSUFFIX=64 BITS=64 - BASE_OPTS="-G\"Visual Studio 12 2013 Win64\"" - add_cmake_opts "-G\"Visual Studio 12 2013 Win64\"" + BASE_OPTS="-G\"$GENERATOR Win64\"" + add_cmake_opts "-G\"$GENERATOR Win64\"" ;; x32|x86|i686|i386|win32|Win32 ) @@ -163,8 +220,8 @@ case $PLATFORM in ARCHSUFFIX=86 BITS=32 - BASE_OPTS="-G\"Visual Studio 12 2013\" -Tv120_xp" - add_cmake_opts "-G\"Visual Studio 12 2013\"" -Tv120_xp + BASE_OPTS="-G\"$GENERATOR\" -T$XP_TOOLSET" + add_cmake_opts "-G\"$GENERATOR\"" -T$XP_TOOLSET ;; * ) diff --git a/appveyor.yml b/appveyor.yml index 631cae63a..0667e0ee0 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -15,7 +15,8 @@ matrix: os: unstable -clone_depth: 1 +shallow_clone: true +#clone_depth: 1 cache: - C:\projects\openmw\deps\Bullet-2.83.5-win32.7z