|
|
@ -1,42 +1,86 @@
|
|
|
|
#!/bin/bash
|
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
while [ $# -gt 0 ]; do
|
|
|
|
ARG=$1
|
|
|
|
ARGSTR=$1
|
|
|
|
shift
|
|
|
|
shift
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if [ ${ARGSTR:0:1} != "-" ]; then
|
|
|
|
|
|
|
|
echo "Unknown argument $ARGSTR"
|
|
|
|
|
|
|
|
echo "Try '$0 -h'"
|
|
|
|
|
|
|
|
exit 1
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for (( i=1; i<${#ARGSTR}; i++ )); do
|
|
|
|
|
|
|
|
ARG=${ARGSTR:$i:1}
|
|
|
|
case $ARG in
|
|
|
|
case $ARG in
|
|
|
|
-v )
|
|
|
|
V )
|
|
|
|
VERBOSE=true ;;
|
|
|
|
VERBOSE=true ;;
|
|
|
|
|
|
|
|
|
|
|
|
-d )
|
|
|
|
v )
|
|
|
|
|
|
|
|
VS_VERSION=$1
|
|
|
|
|
|
|
|
shift ;;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
d )
|
|
|
|
SKIP_DOWNLOAD=true ;;
|
|
|
|
SKIP_DOWNLOAD=true ;;
|
|
|
|
|
|
|
|
|
|
|
|
-e )
|
|
|
|
e )
|
|
|
|
SKIP_EXTRACT=true ;;
|
|
|
|
SKIP_EXTRACT=true ;;
|
|
|
|
|
|
|
|
|
|
|
|
-k )
|
|
|
|
k )
|
|
|
|
KEEP=true ;;
|
|
|
|
KEEP=true ;;
|
|
|
|
|
|
|
|
|
|
|
|
-u )
|
|
|
|
u )
|
|
|
|
UNITY_BUILD=true ;;
|
|
|
|
UNITY_BUILD=true ;;
|
|
|
|
|
|
|
|
|
|
|
|
-p )
|
|
|
|
p )
|
|
|
|
PLATFORM=$1
|
|
|
|
PLATFORM=$1
|
|
|
|
shift ;;
|
|
|
|
shift ;;
|
|
|
|
|
|
|
|
|
|
|
|
-c )
|
|
|
|
c )
|
|
|
|
CONFIGURATION=$1
|
|
|
|
CONFIGURATION=$1
|
|
|
|
shift ;;
|
|
|
|
shift ;;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
h )
|
|
|
|
|
|
|
|
cat <<EOF
|
|
|
|
|
|
|
|
Usage: $0 [-cdehkpuvV]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Options:
|
|
|
|
|
|
|
|
-c <Release/Debug>
|
|
|
|
|
|
|
|
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 <Win32/Win64>
|
|
|
|
|
|
|
|
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 arg $ARG."
|
|
|
|
echo "Unknown argument $ARG."
|
|
|
|
|
|
|
|
echo "Try '$0 -h'"
|
|
|
|
exit 1 ;;
|
|
|
|
exit 1 ;;
|
|
|
|
esac
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
done
|
|
|
|
|
|
|
|
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."
|
|
|
@ -148,14 +192,27 @@ if [ -z $CONFIGURATION ]; then
|
|
|
|
CONFIGURATION="Debug"
|
|
|
|
CONFIGURATION="Debug"
|
|
|
|
fi
|
|
|
|
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
|
|
|
|
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\"Visual Studio 12 2013 Win64\""
|
|
|
|
BASE_OPTS="-G\"$GENERATOR Win64\""
|
|
|
|
add_cmake_opts "-G\"Visual Studio 12 2013 Win64\""
|
|
|
|
add_cmake_opts "-G\"$GENERATOR Win64\""
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
|
|
x32|x86|i686|i386|win32|Win32 )
|
|
|
|
x32|x86|i686|i386|win32|Win32 )
|
|
|
@ -163,8 +220,8 @@ case $PLATFORM in
|
|
|
|
ARCHSUFFIX=86
|
|
|
|
ARCHSUFFIX=86
|
|
|
|
BITS=32
|
|
|
|
BITS=32
|
|
|
|
|
|
|
|
|
|
|
|
BASE_OPTS="-G\"Visual Studio 12 2013\" -Tv120_xp"
|
|
|
|
BASE_OPTS="-G\"$GENERATOR\" -T$XP_TOOLSET"
|
|
|
|
add_cmake_opts "-G\"Visual Studio 12 2013\"" -Tv120_xp
|
|
|
|
add_cmake_opts "-G\"$GENERATOR\"" -T$XP_TOOLSET
|
|
|
|
;;
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
|
|
* )
|
|
|
|
* )
|
|
|
|