1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2024-12-29 12:20:41 +00:00
OpenMW/CI/build.msvc.sh

92 lines
1.6 KiB
Bash
Raw Normal View History

2015-06-02 21:11:09 +00:00
#!/bin/bash
2016-08-28 19:42:48 +00:00
APPVEYOR=""
CI=""
PACKAGE=""
PLATFORM=""
CONFIGURATION=""
VS_VERSION=""
if [ -z $PLATFORM ]; then
PLATFORM=`uname -m`
fi
if [ -z $CONFIGURATION ]; then
CONFIGURATION="Debug"
fi
2016-08-28 19:42:48 +00:00
case $VS_VERSION in
14|14.0|2015 )
GENERATOR="Visual Studio 14 2015"
MSVC_YEAR="2015"
MSVC_VER="14.0"
;;
# 12|2013|
* )
GENERATOR="Visual Studio 12 2013"
MSVC_YEAR="2013"
MVSC_VER="12.0"
;;
esac
2015-06-02 21:50:52 +00:00
case $PLATFORM in
2016-08-28 19:42:48 +00:00
x64|x86_64|x86-64|win64|Win64 )
BITS=64
;;
2015-06-02 21:50:52 +00:00
x32|x86|i686|i386|win32|Win32 )
BITS=32
;;
2016-08-28 19:42:48 +00:00
esac
2015-06-02 21:11:09 +00:00
2016-08-28 19:42:48 +00:00
case $CONFIGURATION in
debug|Debug|DEBUG )
CONFIGURATION=Debug
;;
2015-06-02 21:11:09 +00:00
2016-08-28 19:42:48 +00:00
release|Release|RELEASE )
CONFIGURATION=Release
;;
relwithdebinfo|RelWithDebInfo|RELWITHDEBINFO )
CONFIGURATION=RelWithDebInfo
;;
2015-06-02 21:29:47 +00:00
esac
2015-06-02 21:11:09 +00:00
if [ -z $APPVEYOR ]; then
2016-08-28 19:42:48 +00:00
echo "Running ${BITS}-bit MSVC${MSVC_YEAR} ${CONFIGURATION} build outside of Appveyor."
DIR=$(echo "$0" | sed "s,\\\\,/,g" | sed "s,\(.\):,/\\1,")
cd $(dirname "$DIR")/..
else
2016-08-28 19:42:48 +00:00
echo "Running ${BITS}-bit MSVC${MSVC_YEAR} ${CONFIGURATION} build in Appveyor."
cd $APPVEYOR_BUILD_FOLDER
fi
2016-08-28 19:42:48 +00:00
BUILD_DIR="MSVC${MSVC_YEAR}_${BITS}"
cd ${BUILD_DIR}
2015-06-02 21:11:09 +00:00
which msbuild > /dev/null
if [ $? -ne 0 ]; then
msbuild() {
2016-08-28 19:42:48 +00:00
/c/Program\ Files\ \(x86\)/MSBuild/${MSVC_VER}/Bin/MSBuild.exe "$@"
}
fi
if [ -z $APPVEYOR ]; then
msbuild OpenMW.sln //t:Build //p:Configuration=${CONFIGURATION} //m:8
else
msbuild OpenMW.sln //t:Build //p:Configuration=${CONFIGURATION} //m:8 //logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll"
fi
RET=$?
if [ $RET -eq 0 ] && [ ! -z $PACKAGE ]; then
msbuild PACKAGE.vcxproj //t:Build //m:8
RET=$?
fi
exit $RET