mirror of
https://github.com/OpenRCT2/OpenRCT2
synced 2026-01-25 15:54:31 +01:00
add libversion checks to mingw build
This commit is contained in:
41
build.sh
41
build.sh
@@ -2,10 +2,51 @@
|
||||
|
||||
set -e
|
||||
|
||||
cachedir=.cache
|
||||
mkdir -p $cachedir
|
||||
|
||||
if [[ ! -d build ]]; then
|
||||
mkdir -p build
|
||||
fi
|
||||
|
||||
libversion=1
|
||||
libVFile="./libversion"
|
||||
libdir="./lib"
|
||||
currentversion=0
|
||||
needsdownload="true"
|
||||
|
||||
if [ -f $libVFile ]; then
|
||||
while read line; do
|
||||
currentversion=$line
|
||||
continue
|
||||
done < $libVFile
|
||||
fi
|
||||
|
||||
if [ $currentversion -ge $libversion ]; then
|
||||
needsdownload="false"
|
||||
fi
|
||||
|
||||
if [ ! -d $libdir ]; then
|
||||
needsdownload="true"
|
||||
fi
|
||||
|
||||
if [[ "$needsdownload" = "true" ]]; then
|
||||
echo "New libraries need to be downloaded, the script might ask you for sudo access password"
|
||||
rm -rf ./lib
|
||||
if [[ -f $cachedir/orctlibs.zip ]]; then
|
||||
rm -rf $cachedir/orctlibs.zip
|
||||
fi
|
||||
if [[ -d /usr/local/cross-tools/orctlibs ]]; then
|
||||
sudo rm -rf /usr/local/cross-tools/orctlibs
|
||||
fi
|
||||
curl https://download.openrct2.website/dev/lib/mingw -o $cachedir/orctlibs.zip;
|
||||
sudo mkdir -p /usr/local/cross-tools/orctlibs
|
||||
mkdir -p lib
|
||||
sudo cp -rf $cachedir/orctlibs/glob/* /usr/local/cross-tools/orctlibs/.
|
||||
cp -rf $cachedir/orctlibs/local/* ./lib/.
|
||||
echo $libversion > $libVFile
|
||||
fi
|
||||
|
||||
pushd build
|
||||
cmake -DCMAKE_TOOLCHAIN_FILE=../CMakeLists_mingw.txt -DCMAKE_BUILD_TYPE=Debug ..
|
||||
make
|
||||
|
||||
Reference in New Issue
Block a user