2
1
mirror of https://github.com/qpdf/qpdf.git synced 2024-12-22 02:49:00 +00:00

Convert build-windows to use cmake

This commit is contained in:
Jay Berkenbilt 2022-03-12 07:59:35 -05:00 committed by Jay Berkenbilt
parent 585be5a82e
commit 5ee21c67c9
2 changed files with 24 additions and 20 deletions

View File

@ -4,6 +4,8 @@ cd $(dirname $0)/..
wordsize=$1
tool=$2
declare -a cmake_xargs
declare -a ctest_xargs
if [[ $tool == mingw ]]; then
pacman -Sy --noconfirm make base-devel tar zip unzip
if [ ! -x /c/msys64/mingw$wordsize/bin/g++.exe ]; then
@ -14,24 +16,31 @@ if [[ $tool == mingw ]]; then
fi
fi
PATH="/c/msys64/mingw$wordsize/bin:$PATH"
config=RelWithDebInfo
cmake_xargs=(-- -k)
g++ -v
elif [[ $tool == msvc ]]; then
cl
config=Release
cmake_xargs=(--config $config)
ctest_xargs=(-C $config)
fi
mkdir build distribution
unzip doc.zip
unzip qpdf-external-libs-bin.zip
cwd=`pwd`
PATH=$cwd/libqpdf/build:$PATH
installdir=install-$tool$wordsize
rm -rf $installdir
./config-$tool --enable-show-failed-test-output
make -j$(nproc) -k
make -k check
make install
v=`(cd $installdir; ls -d qpdf-*)`
cp -p README-windows-install.txt $installdir/$v/README.txt
mkdir distribution
(cd $installdir; zip -r ../distribution/$v-bin-$tool$wordsize-ci.zip $v)
cd build
../cmake-win $tool ci
cmake --build . -j$(nproc) "${cmake_xargs[@]}"
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/*

View File

@ -10,11 +10,6 @@ if %2 == msvc (
choco install zip
bash ./build-scripts/build-windows %1 %2
) else (
if exist C:\msys64 (
set MSYS=C:\msys64
) else (
choco install msys2
set MSYS=C:\tools\msys64
)
!MSYS!\usr\bin\env.exe MSYSTEM=MINGW64 /bin/bash -l %CD%/build-scripts/build-windows %1 %2
!MSYS!\usr\bin\env.exe MSYSTEM=MINGW64 MSYS2_PATH_TYPE=inherit /bin/bash -l %CD%/build-scripts/build-windows %1 %2
)