diff --git a/build-scripts/build-windows b/build-scripts/build-windows index e08b653e..76f88f3b 100755 --- a/build-scripts/build-windows +++ b/build-scripts/build-windows @@ -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/* diff --git a/build-scripts/build-windows.bat b/build-scripts/build-windows.bat index e82e0f71..e35b337d 100644 --- a/build-scripts/build-windows.bat +++ b/build-scripts/build-windows.bat @@ -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 + set MSYS=C:\msys64 + !MSYS!\usr\bin\env.exe MSYSTEM=MINGW64 MSYS2_PATH_TYPE=inherit /bin/bash -l %CD%/build-scripts/build-windows %1 %2 )