2018-10-11 13:35:07 -04:00
|
|
|
#!/bin/bash
|
|
|
|
set -ex
|
|
|
|
cd $(dirname $0)/..
|
|
|
|
wordsize=$1
|
|
|
|
tool=$2
|
|
|
|
|
2022-03-12 07:59:35 -05:00
|
|
|
declare -a cmake_xargs
|
|
|
|
declare -a ctest_xargs
|
2018-10-11 13:35:07 -04:00
|
|
|
if [[ $tool == mingw ]]; then
|
|
|
|
pacman -Sy --noconfirm make base-devel tar zip unzip
|
2022-03-08 09:26:40 -05:00
|
|
|
if [ ! -x /c/msys64/mingw$wordsize/bin/g++.exe ]; then
|
2020-10-16 11:29:48 -04:00
|
|
|
if [[ $wordsize == 64 ]]; then
|
|
|
|
pacman -Sy --noconfirm mingw-w64-x86_64-toolchain
|
|
|
|
else
|
|
|
|
pacman -Sy --noconfirm mingw-w64-i686-toolchain
|
|
|
|
fi
|
2018-10-11 13:35:07 -04:00
|
|
|
fi
|
2022-03-08 09:26:40 -05:00
|
|
|
PATH="/c/msys64/mingw$wordsize/bin:$PATH"
|
2022-03-12 07:59:35 -05:00
|
|
|
config=RelWithDebInfo
|
|
|
|
cmake_xargs=(-- -k)
|
2018-10-11 13:35:07 -04:00
|
|
|
g++ -v
|
|
|
|
elif [[ $tool == msvc ]]; then
|
|
|
|
cl
|
2022-03-12 07:59:35 -05:00
|
|
|
config=Release
|
|
|
|
cmake_xargs=(--config $config)
|
|
|
|
ctest_xargs=(-C $config)
|
2018-10-11 13:35:07 -04:00
|
|
|
fi
|
2022-03-12 07:59:35 -05:00
|
|
|
|
|
|
|
mkdir build distribution
|
2021-12-18 11:19:20 -05:00
|
|
|
unzip doc.zip
|
2018-10-11 13:35:07 -04:00
|
|
|
unzip qpdf-external-libs-bin.zip
|
|
|
|
|
2022-03-12 07:59:35 -05:00
|
|
|
cd build
|
|
|
|
../cmake-win $tool ci
|
2022-10-06 07:14:23 -04:00
|
|
|
cmake --build . --verbose -j$(nproc) "${cmake_xargs[@]}"
|
2022-03-12 07:59:35 -05:00
|
|
|
ctest --verbose "${ctest_xargs[@]}"
|
|
|
|
cpack -G NSIS -C $config
|
|
|
|
cpack -G ZIP -C $config
|
|
|
|
for i in qpdf-*.exe; do
|
|
|
|
mv $i ../distribution/$(echo $i | sed -e 's/.exe/-ci.exe/')
|
|
|
|
done
|
|
|
|
for i in qpdf-*.zip; do
|
|
|
|
mv $i ../distribution/$(echo $i | sed -e 's/.zip/-ci.zip/')
|
|
|
|
done
|
|
|
|
cd ..
|
2018-10-12 08:10:08 -04:00
|
|
|
sha256sum distribution/*
|