2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-11-06 05:17:52 +00:00
qpdf/build-scripts/build-windows

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

46 lines
1.1 KiB
Plaintext
Raw Normal View History

#!/bin/bash
set -ex
cd $(dirname $0)/..
wordsize=$1
tool=$2
2022-03-12 12:59:35 +00:00
declare -a cmake_xargs
declare -a ctest_xargs
config=Release
if [[ $tool == mingw ]]; then
pacman -Sy --noconfirm make base-devel tar zip unzip
if [ ! -x /c/msys64/mingw$wordsize/bin/g++.exe ]; then
if [[ $wordsize == 64 ]]; then
pacman -Sy --noconfirm mingw-w64-x86_64-toolchain
else
pacman -Sy --noconfirm mingw-w64-i686-toolchain
fi
fi
PATH="/c/msys64/mingw$wordsize/bin:$PATH"
2022-03-12 12:59:35 +00:00
cmake_xargs=(-- -k)
g++ -v
elif [[ $tool == msvc ]]; then
cl
2022-03-12 12:59:35 +00:00
cmake_xargs=(--config $config)
ctest_xargs=(-C $config)
fi
2022-03-12 12:59:35 +00:00
mkdir build distribution
unzip doc.zip
unzip qpdf-external-libs-bin.zip
2022-03-12 12:59:35 +00:00
cd build
../cmake-win $tool ci $config
cmake --build . --verbose -j$(nproc) "${cmake_xargs[@]}"
2022-03-12 12:59:35 +00: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 ..
sha256sum distribution/*