Visual Studio 2015 support

pull/50/head
Alexander "Ace" Olofsson 8 years ago
parent 92d096f466
commit dd5b6a46f5

@ -1,5 +1,20 @@
#!/bin/bash #!/bin/bash
set -euo pipefail
APPVEYOR=""
CI=""
VERBOSE=""
STRIP=""
SKIP_DOWNLOAD=""
SKIP_EXTRACT=""
KEEP=""
UNITY_BUILD=""
VS_VERSION=""
PLATFORM=""
CONFIGURATION=""
while [ $# -gt 0 ]; do while [ $# -gt 0 ]; do
ARGSTR=$1 ARGSTR=$1
shift shift
@ -16,10 +31,6 @@ while [ $# -gt 0 ]; do
V ) V )
VERBOSE=true ;; VERBOSE=true ;;
v )
VS_VERSION=$1
shift ;;
d ) d )
SKIP_DOWNLOAD=true ;; SKIP_DOWNLOAD=true ;;
@ -32,6 +43,10 @@ while [ $# -gt 0 ]; do
u ) u )
UNITY_BUILD=true ;; UNITY_BUILD=true ;;
v )
VS_VERSION=$1
shift ;;
p ) p )
PLATFORM=$1 PLATFORM=$1
shift ;; shift ;;
@ -78,9 +93,6 @@ done
if [ -z $VERBOSE ]; then if [ -z $VERBOSE ]; then
STRIP="> /dev/null 2>&1" STRIP="> /dev/null 2>&1"
fi fi
if [ -z $VS_VERSION ]; then
VS_VERSION="2013"
fi
if [ -z $APPVEYOR ]; then if [ -z $APPVEYOR ]; then
echo "Running prebuild outside of Appveyor." echo "Running prebuild outside of Appveyor."
@ -90,7 +102,7 @@ if [ -z $APPVEYOR ]; then
else else
echo "Running prebuild in Appveyor." echo "Running prebuild in Appveyor."
cd $APPVEYOR_BUILD_FOLDER cd ${APPVEYOR_BUILD_FOLDER:-}
VERSION="$(cat README.md | grep Version: | awk '{ print $3; }')-$(git rev-parse --short HEAD)" VERSION="$(cat README.md | grep Version: | awk '{ print $3; }')-$(git rev-parse --short HEAD)"
appveyor UpdateBuild -Version "$VERSION" > /dev/null & appveyor UpdateBuild -Version "$VERSION" > /dev/null &
fi fi
@ -192,36 +204,45 @@ if [ -z $CONFIGURATION ]; then
CONFIGURATION="Debug" CONFIGURATION="Debug"
fi fi
if [ -z $VS_VERSION ]; then
VS_VERSION="2013"
fi
case $VS_VERSION in case $VS_VERSION in
14|2015 ) 14|14.0|2015 )
GENERATOR="Visual Studio 14 2015" GENERATOR="Visual Studio 14 2015"
XP_TOOLSET="v140_xp" XP_TOOLSET="v140_xp"
TOOLSET="v140"
MSVC_VER="14"
MSVC_YEAR="2015"
;; ;;
# 12|2013| 12|12.0|2013 )
* )
GENERATOR="Visual Studio 12 2013" GENERATOR="Visual Studio 12 2013"
XP_TOOLSET="v120_xp" XP_TOOLSET="v120_xp"
TOOLSET="v120"
MSVC_VER="12"
MSVC_YEAR="2013"
;; ;;
esac esac
case $PLATFORM in case $PLATFORM in
x64|x86_64|x86-64|win64|Win64 ) x64|x86_64|x86-64|win64|Win64 )
ARCHNAME=x86-64 ARCHNAME="x86-64"
ARCHSUFFIX=64 ARCHSUFFIX="64"
BITS=64 BITS="64"
BASE_OPTS="-G\"$GENERATOR Win64\"" BASE_OPTS="-G\"$GENERATOR Win64\""
add_cmake_opts "-G\"$GENERATOR Win64\"" add_cmake_opts "-G\"$GENERATOR Win64\""
;; ;;
x32|x86|i686|i386|win32|Win32 ) x32|x86|i686|i386|win32|Win32 )
ARCHNAME=x86 ARCHNAME="x86"
ARCHSUFFIX=86 ARCHSUFFIX="86"
BITS=32 BITS="32"
BASE_OPTS="-G\"$GENERATOR\" -T$XP_TOOLSET" BASE_OPTS="-G\"$GENERATOR\""
add_cmake_opts "-G\"$GENERATOR\"" -T$XP_TOOLSET add_cmake_opts "-G\"$GENERATOR\""
;; ;;
* ) * )
@ -230,28 +251,31 @@ case $PLATFORM in
;; ;;
esac esac
if ! [ -z $UNITY_BUILD ]; then
add_cmake_opts "-DOPENMW_UNITY_BUILD=True"
fi
case $CONFIGURATION in case $CONFIGURATION in
debug|Debug|DEBUG ) debug|Debug|DEBUG )
CONFIGURATION=Debug CONFIGURATION=Debug
BUILD_CONFIG=Debug
;; ;;
release|Release|RELEASE ) release|Release|RELEASE )
CONFIGURATION=Release CONFIGURATION=Release
BUILD_CONFIG=Release
;; ;;
relwithdebinfo|RelWithDebInfo|RELWITHDEBINFO ) relwithdebinfo|RelWithDebInfo|RELWITHDEBINFO )
CONFIGURATION=RelWithDebInfo CONFIGURATION=Release
BUILD_CONFIG=RelWithDebInfo
;; ;;
esac esac
if ! [ -z $UNITY_BUILD ]; then
add_cmake_opts "-DOPENMW_UNITY_BUILD=True"
fi
echo echo
echo "==========================" echo "==================================="
echo "Starting prebuild on win$BITS" echo "Starting prebuild on MSVC${MSVC_YEAR} WIN${BITS}"
echo "==========================" echo "==================================="
echo echo
# cd OpenMW/AppVeyor-test # cd OpenMW/AppVeyor-test
@ -266,105 +290,127 @@ if [ -z $SKIP_DOWNLOAD ]; then
# Boost # Boost
if [ -z $APPVEYOR ]; then if [ -z $APPVEYOR ]; then
download "Boost 1.58.0" \ download "Boost 1.61.0" \
http://sourceforge.net/projects/boost/files/boost-binaries/1.58.0/boost_1_58_0-msvc-12.0-$BITS.exe \ "http://sourceforge.net/projects/boost/files/boost-binaries/1.61.0/boost_1_61_0-msvc-${MSVC_VER}.0-${BITS}.exe" \
boost-1.58.0-win$BITS.exe "boost-1.61.0-msvc${MSVC_YEAR}-win${BITS}.exe"
fi fi
# Bullet # Bullet
download "Bullet 2.83.5" \ download "Bullet 2.83.7" \
http://www.lysator.liu.se/~ace/OpenMW/deps/Bullet-2.83.5-win$BITS.7z \ "http://www.lysator.liu.se/~ace/OpenMW/deps/Bullet-2.83.7-msvc${MSVC_YEAR}-win${BITS}.7z" \
Bullet-2.83.5-win$BITS.7z "Bullet-2.83.7-msvc${MSVC_YEAR}-win${BITS}.7z"
# FFmpeg # FFmpeg
download "FFmpeg 2.5.2" \ download "FFmpeg 3.0.1" \
http://ffmpeg.zeranoe.com/builds/win$BITS/shared/ffmpeg-2.5.2-win$BITS-shared.7z \ "http://ffmpeg.zeranoe.com/builds/win${BITS}/shared/ffmpeg-3.0.1-win${BITS}-shared.7z" \
ffmpeg$BITS-2.5.2.7z \ "ffmpeg-3.0.1-win${BITS}.7z" \
http://ffmpeg.zeranoe.com/builds/win$BITS/dev/ffmpeg-2.5.2-win$BITS-dev.7z \ "http://ffmpeg.zeranoe.com/builds/win${BITS}/dev/ffmpeg-3.0.1-win${BITS}-dev.7z" \
ffmpeg$BITS-2.5.2-dev.7z "ffmpeg-3.0.1-dev-win${BITS}.7z"
# MyGUI # MyGUI
download "MyGUI 3.2.2" \ download "MyGUI 3.2.3-git" \
http://www.lysator.liu.se/~ace/OpenMW/deps/MyGUI-3.2.2-win$BITS.7z \ "http://www.lysator.liu.se/~ace/OpenMW/deps/MyGUI-3.2.3-git-msvc${MSVC_YEAR}-win${BITS}.7z" \
MyGUI-3.2.2-win$BITS.7z "MyGUI-3.2.3-git-msvc${MSVC_YEAR}-win${BITS}.7z"
# OpenAL # OpenAL
download "OpenAL-Soft 1.16.0" \ download "OpenAL-Soft 1.17.2" \
http://kcat.strangesoft.net/openal-binaries/openal-soft-1.16.0-bin.zip \ "http://kcat.strangesoft.net/openal-binaries/openal-soft-1.17.2-bin.zip" \
OpenAL-Soft-1.16.0.zip "OpenAL-Soft-1.17.2.zip"
# OSG # OSG
download "OpenSceneGraph 3.3.8" \ download "OpenSceneGraph 3.4.0-scrawl" \
http://www.lysator.liu.se/~ace/OpenMW/deps/OSG-3.3.8-win$BITS.7z \ "http://www.lysator.liu.se/~ace/OpenMW/deps/OSG-3.4.0-scrawl-msvc${MSVC_YEAR}-win${BITS}.7z" \
OSG-3.3.8-win$BITS.7z "OSG-3.4.0-scrawl-msvc${MSVC_YEAR}-win${BITS}.7z"
# Qt # Qt
if [ -z $APPVEYOR ]; then if [ -z $APPVEYOR ]; then
download "Qt 4.8.6" \ if [ $BITS == "64" ]; then
http://sourceforge.net/projects/qt64ng/files/qt/$ARCHNAME/4.8.6/msvc2013/qt-4.8.6-x$ARCHSUFFIX-msvc2013.7z \ QT_SUFFIX="_64"
qt$BITS-4.8.6.7z else
QT_SUFFIX=""
fi
download "Qt 5.7.2" \
"http://download.qt.io/official_releases/qt/5.7/5.7.0/qt-opensource-windows-x86-msvc${MSVC_YEAR}${QT_SUFFIX}-5.7.0.exe" \
"qt-5.7.0-msvc${MSVC_YEAR}-win${BITS}.exe" \
"http://www.lysator.liu.se/~ace/OpenMW/deps/qt-5-install.qs" \
"qt-5-install.qs"
fi fi
# SDL2 # SDL2
download "SDL 2.0.3" \ download "SDL 2.0.4" \
https://www.libsdl.org/release/SDL2-devel-2.0.3-VC.zip \ "https://www.libsdl.org/release/SDL2-devel-2.0.4-VC.zip" \
SDL2-2.0.3.zip "SDL2-2.0.4.zip"
fi fi
cd .. #/.. cd .. #/..
# Set up dependencies # Set up dependencies
BUILD_DIR="MSVC${MSVC_YEAR}_${BITS}"
if [ -z $KEEP ]; then if [ -z $KEEP ]; then
echo echo
printf "Preparing build directory... " echo "(Re)Creating build directory."
rm -rf Build_$BITS
mkdir -p Build_$BITS/deps
echo Done. rm -rf "$BUILD_DIR"
fi fi
mkdir -p Build_$BITS/deps
cd Build_$BITS/deps mkdir -p "${BUILD_DIR}/deps"
cd "${BUILD_DIR}/deps"
DEPS_INSTALL=`pwd` DEPS_INSTALL=`pwd`
cd $DEPS cd $DEPS
echo echo
echo "Extracting dependencies..." echo "Extracting dependencies, this might take a while..."
echo "---------------------------------------------------"
echo
# Boost # Boost
printf "Boost 1.58.0... " if [ -z $APPVEYOR ]; then
printf "Boost 1.61.0... "
else
if [ $MSVC_VER -eq 12 ]; then
printf "Boost 1.58.0 AppVeyor... "
else
printf "Boost 1.60.0 AppVeyor... "
fi
fi
{ {
if [ -z $APPVEYOR ]; then if [ -z $APPVEYOR ]; then
cd $DEPS_INSTALL cd $DEPS_INSTALL
BOOST_SDK="`real_pwd`/Boost" BOOST_SDK="$(real_pwd)/Boost"
if [ -d Boost ] && grep "BOOST_VERSION 105800" Boost/boost/version.hpp > /dev/null; then if [ -d Boost ] && grep "BOOST_VERSION 106100" Boost/boost/version.hpp > /dev/null; then
printf "Exists. " printf "Exists. "
elif [ -z $SKIP_EXTRACT ]; then elif [ -z $SKIP_EXTRACT ]; then
rm -rf Boost rm -rf Boost
$DEPS/boost-1.58.0-win$BITS.exe //dir="$(echo $BOOST_SDK | sed s,/,\\\\,g)" //verysilent "${DEPS}/boost-1.61.0-msvc${MSVC_YEAR}-win${BITS}.exe" //dir="$(echo $BOOST_SDK | sed s,/,\\\\,g)" //verysilent
fi fi
add_cmake_opts -DBOOST_ROOT="$BOOST_SDK" \ add_cmake_opts -DBOOST_ROOT="$BOOST_SDK" \
-DBOOST_LIBRARYDIR="$BOOST_SDK/lib$BITS-msvc-12.0" -DBOOST_LIBRARYDIR="${BOOST_SDK}/lib${BITS}-msvc-${MSVC_VER}.0"
echo Done. echo Done.
else else
# Appveyor unstable has all the boost we need already # Appveyor unstable has all the boost we need already
BOOST_SDK="c:/Libraries/boost" if [ $MSVC_VER -eq 12 ]; then
BOOST_SDK="c:/Libraries/boost_1_58_0"
else
BOOST_SDK="c:/Libraries/boost_1_60_0"
fi
add_cmake_opts -DBOOST_ROOT="$BOOST_SDK" \ add_cmake_opts -DBOOST_ROOT="$BOOST_SDK" \
-DBOOST_LIBRARYDIR="$BOOST_SDK/lib$BITS-msvc-12.0" -DBOOST_LIBRARYDIR="$BOOST_SDK/lib${BITS}-msvc-${MSVC_VER}.0"
echo AppVeyor. echo Done.
fi fi
} }
cd $DEPS cd $DEPS
echo
# Bullet # Bullet
printf "Bullet 2.83.5... " printf "Bullet 2.83.7... "
{ {
cd $DEPS_INSTALL cd $DEPS_INSTALL
@ -372,36 +418,37 @@ printf "Bullet 2.83.5... "
printf "Exists. (No version checking) " printf "Exists. (No version checking) "
elif [ -z $SKIP_EXTRACT ]; then elif [ -z $SKIP_EXTRACT ]; then
rm -rf Bullet rm -rf Bullet
eval 7z x -y $DEPS/Bullet-2.83.5-win$BITS.7z $STRIP eval 7z x -y "${DEPS}/Bullet-2.83.7-msvc${MSVC_YEAR}-win${BITS}.7z" $STRIP
mv Bullet-2.83.5-win$BITS Bullet mv "Bullet-2.83.7-msvc${MSVC_YEAR}-win${BITS}" Bullet
fi fi
export BULLET_ROOT="`real_pwd`/Bullet" export BULLET_ROOT="$(real_pwd)/Bullet"
echo Done. echo Done.
} }
cd $DEPS cd $DEPS
echo
# FFmpeg # FFmpeg
printf "FFmpeg 2.5.2... " printf "FFmpeg 3.0.1... "
{ {
cd $DEPS_INSTALL cd $DEPS_INSTALL
if [ -d FFmpeg ] && grep "FFmpeg version: 2.5.2" FFmpeg/README.txt > /dev/null; then if [ -d FFmpeg ] && grep "FFmpeg version: 3.0.1" FFmpeg/README.txt > /dev/null; then
printf "Exists. " printf "Exists. "
elif [ -z $SKIP_EXTRACT ]; then elif [ -z $SKIP_EXTRACT ]; then
rm -rf FFmpeg rm -rf FFmpeg
eval 7z x -y $DEPS/ffmpeg$BITS-2.5.2.7z $STRIP eval 7z x -y "${DEPS}/ffmpeg-3.0.1-win${BITS}.7z" $STRIP
eval 7z x -y $DEPS/ffmpeg$BITS-2.5.2-dev.7z $STRIP eval 7z x -y "${DEPS}/ffmpeg-3.0.1-dev-win${BITS}.7z" $STRIP
mv ffmpeg-2.5.2-win$BITS-shared FFmpeg mv "ffmpeg-3.0.1-win${BITS}-shared" FFmpeg
cp -r ffmpeg-2.5.2-win$BITS-dev/* FFmpeg/ cp -r "ffmpeg-3.0.1-win${BITS}-dev/"* FFmpeg/
rm -rf ffmpeg-2.5.2-win$BITS-dev rm -rf "ffmpeg-3.0.1-win${BITS}-dev"
fi fi
export FFMPEG_HOME="`real_pwd`/FFmpeg" export FFMPEG_HOME="$(real_pwd)/FFmpeg"
add_runtime_dlls `pwd`/FFmpeg/bin/{avcodec-56,avformat-56,avutil-54,swresample-1,swscale-3}.dll add_runtime_dlls "$(pwd)/FFmpeg/bin/"{avcodec-57,avformat-57,avutil-55,swresample-2,swscale-4}.dll
if [ $BITS -eq 32 ]; then if [ $BITS -eq 32 ]; then
add_cmake_opts "-DCMAKE_EXE_LINKER_FLAGS=\"/machine:X86 /safeseh:no\"" add_cmake_opts "-DCMAKE_EXE_LINKER_FLAGS=\"/machine:X86 /safeseh:no\""
@ -410,36 +457,38 @@ printf "FFmpeg 2.5.2... "
echo Done. echo Done.
} }
cd $DEPS cd $DEPS
echo
# MyGUI # MyGUI
printf "MyGUI 3.2.2... " printf "MyGUI 3.2.3-git... "
{ {
cd $DEPS_INSTALL cd $DEPS_INSTALL
if [ -d MyGUI ] && \ if [ -d MyGUI ] && \
grep "MYGUI_VERSION_MAJOR 3" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null && \ grep "MYGUI_VERSION_MAJOR 3" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null && \
grep "MYGUI_VERSION_MINOR 2" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null && \ grep "MYGUI_VERSION_MINOR 2" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null && \
grep "MYGUI_VERSION_PATCH 2" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null grep "MYGUI_VERSION_PATCH 3" MyGUI/include/MYGUI/MyGUI_Prerequest.h > /dev/null
then then
printf "Exists. " printf "Exists. "
elif [ -z $SKIP_EXTRACT ]; then elif [ -z $SKIP_EXTRACT ]; then
rm -rf MyGUI rm -rf MyGUI
eval 7z x -y $DEPS/MyGUI-3.2.2-win$BITS.7z $STRIP eval 7z x -y "${DEPS}/MyGUI-3.2.3-git-msvc${MSVC_YEAR}-win${BITS}.7z" $STRIP
mv MyGUI-3.2.2-win$BITS MyGUI mv "MyGUI-3.2.3-git-msvc${MSVC_YEAR}-win${BITS}" MyGUI
fi fi
export MYGUI_HOME="`real_pwd`/MyGUI" export MYGUI_HOME="$(real_pwd)/MyGUI"
if [ $CONFIGURATION == "Debug" ]; then if [ $CONFIGURATION == "Debug" ]; then
SUFFIX="_d" SUFFIX="_d"
else else
SUFFIX="" SUFFIX=""
fi fi
add_runtime_dlls `pwd`/MyGUI/bin/$CONFIGURATION/MyGUIEngine$SUFFIX.dll add_runtime_dlls "$(pwd)/MyGUI/bin/${CONFIGURATION}/MyGUIEngine${SUFFIX}.dll"
echo Done. echo Done.
} }
cd $DEPS cd $DEPS
echo
# OpenAL # OpenAL
printf "OpenAL-Soft 1.16.0... " printf "OpenAL-Soft 1.16.0... "
@ -451,7 +500,7 @@ printf "OpenAL-Soft 1.16.0... "
eval 7z x -y OpenAL-Soft-1.16.0.zip $STRIP eval 7z x -y OpenAL-Soft-1.16.0.zip $STRIP
fi fi
OPENAL_SDK="`real_pwd`/openal-soft-1.16.0-bin" OPENAL_SDK="$(real_pwd)/openal-soft-1.16.0-bin"
add_cmake_opts -DOPENAL_INCLUDE_DIR="$OPENAL_SDK/include/AL" \ add_cmake_opts -DOPENAL_INCLUDE_DIR="$OPENAL_SDK/include/AL" \
-DOPENAL_LIBRARY="$OPENAL_SDK/libs/Win$BITS/OpenAL32.lib" -DOPENAL_LIBRARY="$OPENAL_SDK/libs/Win$BITS/OpenAL32.lib"
@ -459,25 +508,26 @@ printf "OpenAL-Soft 1.16.0... "
echo Done. echo Done.
} }
cd $DEPS cd $DEPS
echo
# OSG # OSG
printf "OSG 3.3.8... " printf "OSG 3.4.0-scrawl... "
{ {
cd $DEPS_INSTALL cd $DEPS_INSTALL
if [ -d OSG ] && \ if [ -d OSG ] && \
grep "OPENSCENEGRAPH_MAJOR_VERSION 3" OSG/include/osg/Version > /dev/null && \ grep "OPENSCENEGRAPH_MAJOR_VERSION 3" OSG/include/osg/Version > /dev/null && \
grep "OPENSCENEGRAPH_MINOR_VERSION 3" OSG/include/osg/Version > /dev/null && \ grep "OPENSCENEGRAPH_MINOR_VERSION 4" OSG/include/osg/Version > /dev/null && \
grep "OPENSCENEGRAPH_PATCH_VERSION 8" OSG/include/osg/Version > /dev/null grep "OPENSCENEGRAPH_PATCH_VERSION 0" OSG/include/osg/Version > /dev/null
then then
printf "Exists. " printf "Exists. "
elif [ -z $SKIP_EXTRACT ]; then elif [ -z $SKIP_EXTRACT ]; then
rm -rf OSG rm -rf OSG
eval 7z x -y $DEPS/OSG-3.3.8-win$BITS.7z $STRIP eval 7z x -y "${DEPS}/OSG-3.4.0-scrawl-msvc${MSVC_YEAR}-win${BITS}.7z" $STRIP
mv OSG-3.3.8-win$BITS OSG mv "OSG-3.4.0-scrawl-msvc${MSVC_YEAR}-win${BITS}" OSG
fi fi
OSG_SDK="`real_pwd`/OSG" OSG_SDK="$(real_pwd)/OSG"
add_cmake_opts -DOSG_DIR="$OSG_SDK" add_cmake_opts -DOSG_DIR="$OSG_SDK"
@ -487,82 +537,96 @@ printf "OSG 3.3.8... "
SUFFIX="" SUFFIX=""
fi fi
add_runtime_dlls `pwd`/OSG/bin/{OpenThreads,zlib}$SUFFIX.dll \ add_runtime_dlls "$(pwd)/OSG/bin/"{OpenThreads,zlib}${SUFFIX}.dll \
`pwd`/OSG/bin/osg{,Animation,DB,FX,GA,Particle,Qt,Text,Util,Viewer}$SUFFIX.dll "$(pwd)/OSG/bin/osg"{,Animation,DB,FX,GA,Particle,Text,Util,Viewer}${SUFFIX}.dll
add_osg_dlls `pwd`/OSG/bin/osgPlugins-3.3.8/osgdb_{bmp,dds,gif,jpeg,png,tga}$SUFFIX.dll add_osg_dlls "$(pwd)/OSG/bin/osgPlugins-3.4.0/osgdb_"{bmp,dds,jpeg,png,tga}${SUFFIX}.dll
echo Done. echo Done.
} }
cd $DEPS cd $DEPS
echo
# Qt # Qt
if [ -z $APPVEYOR ]; then if [ -z $APPVEYOR ]; then
printf "Qt 4.8.6... " printf "Qt 5.7.0... "
else else
printf "Qt 5.4... " printf "Qt 5.7 AppVeyor... "
fi fi
{ {
if [ $BITS -eq 64 ]; then
SUFFIX="_64"
else
SUFFIX=""
fi
if [ -z $APPVEYOR ]; then if [ -z $APPVEYOR ]; then
cd $DEPS_INSTALL cd $DEPS_INSTALL
QT_SDK="`real_pwd`/Qt" QT_SDK="$(real_pwd)/Qt/5.7/msvc${MSVC_YEAR}${SUFFIX}"
if [ -d Qt ] && head -n2 Qt/BUILDINFO.txt | grep "4.8.6" > /dev/null; then if [ -d Qt ] && head -n2 Qt/InstallationLog.txt | grep "5.7.0" > /dev/null; then
printf "Exists. " printf "Exists. "
elif [ -z $SKIP_EXTRACT ]; then elif [ -z $SKIP_EXTRACT ]; then
rm -rf Qt rm -rf Qt
eval 7z x -y $DEPS/qt$BITS-4.8.6.7z $STRIP cp "${DEPS}/qt-5-install.qs" qt-install.qs
mv qt-4.8.6-* Qt
cd Qt
eval ./qtbinpatcher.exe $STRIP sed -i "s|INSTALL_DIR|$(real_pwd)/Qt|" qt-install.qs
sed -i "s/qt.VERSION.winBITS_msvcYEAR/qt.57.win${BITS}_msvc${MSVC_YEAR}${SUFFIX}/" qt-install.qs
printf "(Installation might take a while) "
"${DEPS}/qt-5.7.0-msvc${MSVC_YEAR}-win${BITS}.exe" --script qt-install.qs --silent
mv qt-install.qs Qt/
echo Done.
printf " Cleaning up extraneous data... "
rm -r "$(real_pwd)/Qt/"{Docs,Examples,Tools,vcredist,MaintenanceTool.*}
fi fi
cd $QT_SDK cd $QT_SDK
add_cmake_opts -DDESIRED_QT_VERSION=4 \ add_cmake_opts -DDESIRED_QT_VERSION=5 \
-DQT_QMAKE_EXECUTABLE="$QT_SDK/bin/qmake.exe" -DQT_QMAKE_EXECUTABLE="$QT_SDK/bin/qmake.exe" \
-DCMAKE_PREFIX_PATH="$QT_SDK"
if [ $CONFIGURATION == "Debug" ]; then if [ $CONFIGURATION == "Debug" ]; then
SUFFIX="d4" SUFFIX="d"
else
SUFFIX="4"
fi fi
add_runtime_dlls `pwd`/bin/Qt{Core,Gui,Network,OpenGL}$SUFFIX.dll add_runtime_dlls "$(pwd)/bin/Qt5"{Core,Gui,Network,OpenGL}$SUFFIX.dll
echo Done. echo Done.
else else
if [ $BITS -eq 32 ]; then QT_SDK="C:/Qt/5.7/msvc${MSVC_YEAR}${SUFFIX}"
QT_SDK="C:/Qt/5.4/msvc2013_opengl"
else
QT_SDK="C:/Qt/5.4/msvc2013_64_opengl"
fi
add_cmake_opts -DDESIRED_QT_VERSION=5 \ add_cmake_opts -DDESIRED_QT_VERSION=5 \
-DQT_QMAKE_EXECUTABLE="$QT_SDK/bin/qmake.exe" \ -DQT_QMAKE_EXECUTABLE="$QT_SDK/bin/qmake.exe" \
-DCMAKE_PREFIX_PATH="$QT_SDK" -DCMAKE_PREFIX_PATH="$QT_SDK"
echo AppVeyor. echo Done.
fi fi
} }
cd $DEPS cd $DEPS
echo
# SDL2 # SDL2
printf "SDL 2.0.3... " printf "SDL 2.0.4... "
{ {
if [ -d SDL2-2.0.3 ]; then if [ -d SDL2-2.0.4 ]; then
printf "Exists. " printf "Exists. "
elif [ -z $SKIP_EXTRACT ]; then elif [ -z $SKIP_EXTRACT ]; then
rm -rf SDL2-2.0.3 rm -rf SDL2-2.0.4
eval 7z x -y SDL2-2.0.3.zip $STRIP eval 7z x -y SDL2-2.0.4.zip $STRIP
fi fi
export SDL2DIR="`real_pwd`/SDL2-2.0.3" export SDL2DIR="$(real_pwd)/SDL2-2.0.4"
add_runtime_dlls $SDL2DIR/lib/x$ARCHSUFFIX/SDL2.dll add_runtime_dlls "${SDL2DIR}/lib/x${ARCHSUFFIX}/SDL2.dll"
echo Done. echo Done.
} }
echo
cd $DEPS_INSTALL/.. cd $DEPS_INSTALL/..
@ -575,12 +639,10 @@ add_cmake_opts -DBUILD_BSATOOL=no \
-DBUILD_MYGUI_PLUGIN=no \ -DBUILD_MYGUI_PLUGIN=no \
-DOPENMW_MP_BUILD=on -DOPENMW_MP_BUILD=on
if [ -z $CI ]; then if [ ! -z $CI ]; then
echo " (Outside of CI, doing full build.)"
else
case $STEP in case $STEP in
components ) components )
echo " Subproject: Components." echo " Building subproject: Components."
add_cmake_opts -DBUILD_ESSIMPORTER=no \ add_cmake_opts -DBUILD_ESSIMPORTER=no \
-DBUILD_LAUNCHER=no \ -DBUILD_LAUNCHER=no \
-DBUILD_MWINIIMPORTER=no \ -DBUILD_MWINIIMPORTER=no \
@ -588,77 +650,80 @@ else
-DBUILD_OPENMW=no \ -DBUILD_OPENMW=no \
-DBUILD_WIZARD=no -DBUILD_WIZARD=no
;; ;;
openmw ) openmw )
echo " Subproject: OpenMW." echo " Building subproject: OpenMW."
add_cmake_opts -DBUILD_ESSIMPORTER=no \ add_cmake_opts -DBUILD_ESSIMPORTER=no \
-DBUILD_LAUNCHER=no \ -DBUILD_LAUNCHER=no \
-DBUILD_MWINIIMPORTER=no \ -DBUILD_MWINIIMPORTER=no \
-DBUILD_OPENCS=no \ -DBUILD_OPENCS=no \
-DBUILD_WIZARD=no -DBUILD_WIZARD=no
;; ;;
opencs ) opencs )
echo " Subproject: OpenCS." echo " Building subproject: OpenCS."
add_cmake_opts -DBUILD_ESSIMPORTER=no \ add_cmake_opts -DBUILD_ESSIMPORTER=no \
-DBUILD_LAUNCHER=no \ -DBUILD_LAUNCHER=no \
-DBUILD_MWINIIMPORTER=no \ -DBUILD_MWINIIMPORTER=no \
-DBUILD_OPENMW=no \ -DBUILD_OPENMW=no \
-DBUILD_WIZARD=no -DBUILD_WIZARD=no
;; ;;
misc ) misc )
echo " Subproject: Misc." echo " Building subprojects: Misc."
add_cmake_opts -DBUILD_OPENCS=no \ add_cmake_opts -DBUILD_OPENCS=no \
-DBUILD_OPENMW=no -DBUILD_OPENMW=no
;; ;;
* )
echo " Building everything."
;;
esac esac
fi fi
if [ -z $VERBOSE ]; then if [ -z $VERBOSE ]; then
printf " Configuring... " printf "- Configuring... "
else else
echo " cmake .. $CMAKE_OPTS" echo "- cmake .. $CMAKE_OPTS"
fi fi
run_cmd cmake .. $CMAKE_OPTS run_cmd cmake .. $CMAKE_OPTS
RET=$? RET=$?
if [ -z $VERBOSE ]; then if [ -z $VERBOSE ]; then
if [ $RET -eq 0 ]; then echo Done. if [ $RET -eq 0 ]; then
else echo Failed.; fi echo Done.
else
echo Failed.
fi
fi fi
echo echo
# NOTE: Disable this when/if we want to run test cases # NOTE: Disable this when/if we want to run test cases
if [ -z $CI ]; then if [ -z $CI ]; then
echo "Copying Runtime DLLs..." echo "- Copying Runtime DLLs..."
mkdir -p $CONFIGURATION mkdir -p $BUILD_CONFIG
for DLL in $RUNTIME_DLLS; do for DLL in $RUNTIME_DLLS; do
echo " `basename $DLL`." echo " `basename $DLL`."
cp "$DLL" $CONFIGURATION/ cp "$DLL" $BUILD_CONFIG/
done done
echo "OSG Plugin DLLs..." echo "- OSG Plugin DLLs..."
mkdir -p $CONFIGURATION/osgPlugins-3.3.8 mkdir -p $BUILD_CONFIG/osgPlugins-3.4.0
for DLL in $OSG_PLUGINS; do for DLL in $OSG_PLUGINS; do
echo " `basename $DLL`." echo " `basename $DLL`."
cp "$DLL" $CONFIGURATION/osgPlugins-3.3.8 cp "$DLL" $BUILD_CONFIG/osgPlugins-3.4.0
done done
echo echo
echo "Copying Runtime Resources/Config Files" echo "- Copying Runtime Resources/Config Files"
echo " gamecontrollerdb.txt" echo " gamecontrollerdb.txt"
cp $CONFIGURATION/../gamecontrollerdb.txt $CONFIGURATION/gamecontrollerdb.txt cp gamecontrollerdb.txt $BUILD_CONFIG/gamecontrollerdb.txt
echo " openmw.cfg" echo " openmw.cfg"
cp $CONFIGURATION/../openmw.cfg.install $CONFIGURATION/openmw.cfg cp openmw.cfg.install $BUILD_CONFIG/openmw.cfg
echo " openmw-cs.cfg" echo " openmw-cs.cfg"
cp $CONFIGURATION/../openmw-cs.cfg $CONFIGURATION/openmw-cs.cfg cp openmw-cs.cfg $BUILD_CONFIG/openmw-cs.cfg
echo " settings-default.cfg" echo " settings-default.cfg"
cp $CONFIGURATION/../settings-default.cfg $CONFIGURATION/settings-default.cfg cp settings-default.cfg $BUILD_CONFIG/settings-default.cfg
echo " resources/" echo " resources/"
cp -r $CONFIGURATION/../resources $CONFIGURATION/resources cp -r resources $BUILD_CONFIG/resources
fi fi
exit $RET exit $RET

@ -1,5 +1,13 @@
#!/bin/bash #!/bin/bash
APPVEYOR=""
CI=""
PACKAGE=""
PLATFORM=""
CONFIGURATION=""
VS_VERSION=""
if [ -z $PLATFORM ]; then if [ -z $PLATFORM ]; then
PLATFORM=`uname -m` PLATFORM=`uname -m`
fi fi
@ -8,39 +16,63 @@ if [ -z $CONFIGURATION ]; then
CONFIGURATION="Debug" CONFIGURATION="Debug"
fi fi
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
case $PLATFORM in case $PLATFORM in
x64|x86_64|x86-64|win64|Win64 )
BITS=64
;;
x32|x86|i686|i386|win32|Win32 ) x32|x86|i686|i386|win32|Win32 )
BITS=32 BITS=32
PLATFORM=Win32
;; ;;
esac
x64|x86_64|x86-64|win64|Win64 ) case $CONFIGURATION in
BITS=64 debug|Debug|DEBUG )
PLATFORM=x64 CONFIGURATION=Debug
;; ;;
* ) release|Release|RELEASE )
echo "Unknown platform $PLATFORM." CONFIGURATION=Release
exit 1 ;; ;;
relwithdebinfo|RelWithDebInfo|RELWITHDEBINFO )
CONFIGURATION=RelWithDebInfo
;;
esac esac
if [ -z $APPVEYOR ]; then if [ -z $APPVEYOR ]; then
echo "Running $BITS-bit $CONFIGURATION build outside of Appveyor." echo "Running ${BITS}-bit MSVC${MSVC_YEAR} ${CONFIGURATION} build outside of Appveyor."
DIR=$(echo "$0" | sed "s,\\\\,/,g" | sed "s,\(.\):,/\\1,") DIR=$(echo "$0" | sed "s,\\\\,/,g" | sed "s,\(.\):,/\\1,")
cd $(dirname "$DIR")/.. cd $(dirname "$DIR")/..
else else
echo "Running $BITS-bit $CONFIGURATION build in Appveyor." echo "Running ${BITS}-bit MSVC${MSVC_YEAR} ${CONFIGURATION} build in Appveyor."
cd $APPVEYOR_BUILD_FOLDER cd $APPVEYOR_BUILD_FOLDER
fi fi
cd build_$BITS BUILD_DIR="MSVC${MSVC_YEAR}_${BITS}"
cd ${BUILD_DIR}
which msbuild > /dev/null which msbuild > /dev/null
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
msbuild() { msbuild() {
/c/Program\ Files\ \(x86\)/MSBuild/12.0/Bin/MSBuild.exe "$@" /c/Program\ Files\ \(x86\)/MSBuild/${MSVC_VER}/Bin/MSBuild.exe "$@"
} }
fi fi

@ -599,6 +599,7 @@ if (WIN32)
# They're unneeded and sometimes completely retarded warnings that /Wall enables # They're unneeded and sometimes completely retarded warnings that /Wall enables
# Not going to bother commenting them as they tend to warn on every standard library file # Not going to bother commenting them as they tend to warn on every standard library file
4061 4263 4264 4266 4350 4371 4435 4514 4548 4571 4610 4619 4623 4625 4626 4628 4640 4668 4710 4711 4820 4826 4917 4946 4061 4263 4264 4266 4350 4371 4435 4514 4548 4571 4610 4619 4623 4625 4626 4628 4640 4668 4710 4711 4820 4826 4917 4946
5026 5027
# Warnings that are thrown on standard libraries and not OpenMW # Warnings that are thrown on standard libraries and not OpenMW
4347 # Non-template function with same name and parameter count as template function 4347 # Non-template function with same name and parameter count as template function
@ -610,8 +611,15 @@ if (WIN32)
4987 # nonstandard extension used (triggered by setjmp.h) 4987 # nonstandard extension used (triggered by setjmp.h)
4996 # Function was declared deprecated 4996 # Function was declared deprecated
# caused by OSG
4589 # Constructor of abstract class 'osg::Operation' ignores initializer for virtual base class 'osg::Referenced' (False warning)
# caused by boost # caused by boost
4191 # 'type cast' : unsafe conversion (1.56, thread_primitives.hpp, normally off) 4191 # 'type cast' : unsafe conversion (1.56, thread_primitives.hpp, normally off)
5031 # #pragma warning(pop): likely mismatch, popping warning state pushed in different file (config_begin.hpp, config_end.hpp)
# caused by MyGUI
4275 # non dll-interface class 'std::exception' used as base for dll-interface class 'MyGUI::Exception'
# OpenMW specific warnings # OpenMW specific warnings
4099 # Type mismatch, declared class or struct is defined with other type 4099 # Type mismatch, declared class or struct is defined with other type
@ -626,9 +634,11 @@ if (WIN32)
4309 # Variable overflow, trying to store 128 in a signed char for example 4309 # Variable overflow, trying to store 128 in a signed char for example
4351 # New behavior: elements of array 'array' will be default initialized (desired behavior) 4351 # New behavior: elements of array 'array' will be default initialized (desired behavior)
4355 # Using 'this' in member initialization list 4355 # Using 'this' in member initialization list
4464 # relative include path contains '..'
4505 # Unreferenced local function has been removed 4505 # Unreferenced local function has been removed
4701 # Potentially uninitialized local variable used 4701 # Potentially uninitialized local variable used
4702 # Unreachable code 4702 # Unreachable code
4714 # function 'QString QString::trimmed(void) &&' marked as __forceinline not inlined
4800 # Boolean optimization warning, e.g. myBool = (myInt != 0) instead of myBool = myInt 4800 # Boolean optimization warning, e.g. myBool = (myInt != 0) instead of myBool = myInt
) )

@ -6,38 +6,49 @@ branches:
- /openmw-.*$/ - /openmw-.*$/
- appveyor - appveyor
environment:
matrix:
- msvc: 2013
- msvc: 2015
platform: platform:
- Win32 - Win32
# - x64 # - x64
configuration: Debug
matrix: configuration:
fast_finish: true - Debug
# - Release
# For the Qt, Boost, CMake, etc installs # For the Qt, Boost, CMake, etc installs
os: unstable os: Visual Studio 2015
# We want the git revision for versioning, # We want the git revision for versioning,
# so shallow clones don't work. # so shallow clones don't work.
clone_depth: 1 clone_depth: 1
cache: cache:
- C:\projects\openmw\deps\Bullet-2.83.5-win32.7z - C:\projects\openmw\deps\Bullet-2.83.7-msvc2013-win32.7z
- C:\projects\openmw\deps\Bullet-2.83.5-win64.7z - C:\projects\openmw\deps\Bullet-2.83.7-msvc2013-win64.7z
- C:\projects\openmw\deps\MyGUI-3.2.2-win32.7z - C:\projects\openmw\deps\Bullet-2.83.7-msvc2015-win32.7z
- C:\projects\openmw\deps\MyGUI-3.2.2-win64.7z - C:\projects\openmw\deps\Bullet-2.83.7-msvc2015-win64.7z
- C:\projects\openmw\deps\OSG-3.3.8-win32.7z - C:\projects\openmw\deps\MyGUI-3.2.3-git-msvc2013-win32.7z
- C:\projects\openmw\deps\OSG-3.3.8-win64.7z - C:\projects\openmw\deps\MyGUI-3.2.3-git-msvc2013-win32.7z
- C:\projects\openmw\deps\ffmpeg32-2.5.2.7z - C:\projects\openmw\deps\MyGUI-3.2.3-git-msvc2015-win64.7z
- C:\projects\openmw\deps\ffmpeg32-2.5.2-dev.7z - C:\projects\openmw\deps\MyGUI-3.2.3-git-msvc2015-win64.7z
- C:\projects\openmw\deps\ffmpeg64-2.5.2.7z - C:\projects\openmw\deps\OSG-3.4.0-scrawl-msvc2013-win32.7z
- C:\projects\openmw\deps\ffmpeg64-2.5.2-dev.7z - C:\projects\openmw\deps\OSG-3.4.0-scrawl-msvc2013-win32.7z
- C:\projects\openmw\deps\OSG-3.4.0-scrawl-msvc2015-win64.7z
- C:\projects\openmw\deps\OSG-3.4.0-scrawl-msvc2015-win64.7z
- C:\projects\openmw\deps\ffmpeg-3.0.1-dev-win32.7z
- C:\projects\openmw\deps\ffmpeg-3.0.1-dev-win64.7z
- C:\projects\openmw\deps\ffmpeg-3.0.1-win32.7z
- C:\projects\openmw\deps\ffmpeg-3.0.1-win64.7z
- C:\projects\openmw\deps\qt-5-install.qs
clone_folder: C:\projects\openmw clone_folder: C:\projects\openmw
before_build: before_build:
- cmd: sh %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh -u -p %PLATFORM% - cmd: sh %APPVEYOR_BUILD_FOLDER%\CI\before_script.msvc.sh -u -p %PLATFORM% -v %msvc%
build_script: build_script:
- cmd: if %PLATFORM%==Win32 set build=Build_32 - cmd: if %PLATFORM%==Win32 set build=Build_32

Loading…
Cancel
Save