Merge remote-tracking branch 'upstream/develop' into develop

This commit is contained in:
Enno Rehling 2018-02-02 19:50:10 +01:00
commit 096861fc62
4 changed files with 40 additions and 15 deletions

View File

@ -38,8 +38,12 @@ else (MSVC)
find_package (Curses)
endif (MSVC)
find_package (SQLite3)
find_package (BerkeleyDB)
if (ERESSEA_DB STREQUAL "db")
find_package (BerkeleyDB REQUIRED QUIET)
else()
find_package (SQLite3 REQUIRED QUIET)
endif()
find_package (LibXml2 REQUIRED)
find_package (ToLua REQUIRED)
if (TOLUA_FOUND)

View File

@ -3703,7 +3703,7 @@
</string>
<string name="sound_out">
<text locale="de">Aushorchen</text>
<text locale="en">sound_out</text>
<text locale="en">Sound out</text>
</string>
<string name="bloodthirst">
<text locale="de">Kriegsgesang</text>

View File

@ -31,15 +31,18 @@ if [ ! -d $ROOT/$BUILD ]; then
fi
echo "build eressea"
CMAKE_ARGS=".."
cd $ROOT/$BUILD
BRANCH=$(git status -s -b | head -1 | cut -d\ -f 2 | sed 's/\..*//')
if [ "$BRANCH" = "master" ] ; then
VERSION=$(git describe --match 'v*.*.*' --tags | sed 's/^v//')
echo "$BRANCH $VERSION"
cmake -DERESSEA_VERSION="$VERSION" ..
CMAKE_ARGS="-DERESSEA_VERSION=$VERSION ${CMAKE_ARGS}"
else
REV=$(git rev-parse --short HEAD)
cmake -DERESSEA_BUILDNO="$REV" ..
CMAKE_ARGS="-DERESSEA_BUILDNO=$REV $CMAKE_ARGS"
fi
cmake ${CMAKE_ARGS}
make $MAKEOPTS && make test
cd $OLDPWD

View File

@ -1,5 +1,20 @@
#!/bin/sh
ERESSEA_DB=sqlite
if [ -e /usr/include/db.h ] ; then
ERESSEA_DB=db
fi
# Parse command line arguments
while [ ! -z "$1" ] ; do
if [ "$1" = "--with-db" ] ; then
ERESSEA_DB=db
elif [ "$1" = "--with-sqlite" ] ; then
ERESSEA_DB=sqlite
fi
shift 1
done
ROOT=$(git rev-parse --show-toplevel)
[ -z $BUILD ] && BUILD=Debug
[ -z "$CC" ] && [ ! -z `which clang` ] && CC="clang"
@ -15,8 +30,6 @@ mkdir -p $BIN_DIR
rm -f $BUILD
ln -sf $BIN_DIR $BUILD
rm -f CMakeCache.txt
# use anything installed in /opt or /usr
LIBRARY_PATH=/opt/lib:/opt/lib/$MACHINE:/usr/lib/$MACHINE
INCLUDE_PATH=/opt/include:/usr/include
@ -30,11 +43,6 @@ if [ -d $HOME/usr ]; then
fi
DEST=$(dirname $ROOT)/server
ARGS=" -DCMAKE_BUILD_TYPE=$BUILD \
-DCMAKE_LIBRARY_PATH=$LIBRARY_PATH \
-DCMAKE_PREFIX_PATH=$PREFIX_PATH \
-DCMAKE_INSTALL_PREFIX=$DEST"
# -DCMAKE_INCLUDE_PATH=$INCLUDE_PATH
git submodule update --init
@ -46,7 +54,17 @@ elif [ -d /usr/local/include/lua5.1 ]; then
LUA_DIR=/usr/local
LUA_VERSION="5.1"
fi
export LUA_DIR
cat >| $BUILD/config.cmake <<HEREDOC
SET (ERESSEA_DB "$ERESSEA_DB" CACHE STRING "Database driver")
SET (LUA_DIR "$LUA_DIR" CACHE PATH "Lua root path")
SET (CMAKE_BUILD_TYPE "$BUILD" FORCE)
SET (CMAKE_INSTALL_PREFIX "$DEST" CACHE PATH "")
SET (CMAKE_LIBRARY_PATH "$LIBRARY_PATH" CACHE PATH "")
SET (CMAKE_PREFIX_PATH "$PREFIX_PATH" CACHE PATH "")
HEREDOC
#echo 'SET (LUA_DIR "$LUA_DIR" PATH)' >> $BUILD/config.cmake
path="$(which tolua)"
if [ "$HAVE_TOLUA" = "0" ] || [ -z $path ] ; then
@ -59,7 +77,7 @@ if [ "$HAVE_TOLUA" = "0" ] || [ -z $path ] ; then
echo "building tolua..."
cd tolua
make
ARGS="$ARGS -DPC_TOLUA_DIR=$ROOT/tolua"
echo 'SET(PC_TOLUA_DIR "$ROOT/tolua" CACHE PATH "tolua root")' >> $BUILD/config.cmake
else
echo "tolua is $path"
fi
@ -68,6 +86,6 @@ unset path
set -e
cd $BIN_DIR
cmake .. $ARGS $*
cmake -C config.cmake .. $*
cd $OLDPWD