Commit 5ee21c67c9b5923add9c050c365fe4423c50dac9
Committed by
Jay Berkenbilt
1 parent
585be5a8
Convert build-windows to use cmake
Showing
2 changed files
with
24 additions
and
20 deletions
build-scripts/build-windows
| @@ -4,6 +4,8 @@ cd $(dirname $0)/.. | @@ -4,6 +4,8 @@ cd $(dirname $0)/.. | ||
| 4 | wordsize=$1 | 4 | wordsize=$1 |
| 5 | tool=$2 | 5 | tool=$2 |
| 6 | 6 | ||
| 7 | +declare -a cmake_xargs | ||
| 8 | +declare -a ctest_xargs | ||
| 7 | if [[ $tool == mingw ]]; then | 9 | if [[ $tool == mingw ]]; then |
| 8 | pacman -Sy --noconfirm make base-devel tar zip unzip | 10 | pacman -Sy --noconfirm make base-devel tar zip unzip |
| 9 | if [ ! -x /c/msys64/mingw$wordsize/bin/g++.exe ]; then | 11 | if [ ! -x /c/msys64/mingw$wordsize/bin/g++.exe ]; then |
| @@ -14,24 +16,31 @@ if [[ $tool == mingw ]]; then | @@ -14,24 +16,31 @@ if [[ $tool == mingw ]]; then | ||
| 14 | fi | 16 | fi |
| 15 | fi | 17 | fi |
| 16 | PATH="/c/msys64/mingw$wordsize/bin:$PATH" | 18 | PATH="/c/msys64/mingw$wordsize/bin:$PATH" |
| 19 | + config=RelWithDebInfo | ||
| 20 | + cmake_xargs=(-- -k) | ||
| 17 | g++ -v | 21 | g++ -v |
| 18 | elif [[ $tool == msvc ]]; then | 22 | elif [[ $tool == msvc ]]; then |
| 19 | cl | 23 | cl |
| 24 | + config=Release | ||
| 25 | + cmake_xargs=(--config $config) | ||
| 26 | + ctest_xargs=(-C $config) | ||
| 20 | fi | 27 | fi |
| 28 | + | ||
| 29 | +mkdir build distribution | ||
| 21 | unzip doc.zip | 30 | unzip doc.zip |
| 22 | unzip qpdf-external-libs-bin.zip | 31 | unzip qpdf-external-libs-bin.zip |
| 23 | -cwd=`pwd` | ||
| 24 | -PATH=$cwd/libqpdf/build:$PATH | ||
| 25 | - | ||
| 26 | -installdir=install-$tool$wordsize | ||
| 27 | -rm -rf $installdir | ||
| 28 | -./config-$tool --enable-show-failed-test-output | ||
| 29 | -make -j$(nproc) -k | ||
| 30 | -make -k check | ||
| 31 | -make install | ||
| 32 | 32 | ||
| 33 | -v=`(cd $installdir; ls -d qpdf-*)` | ||
| 34 | -cp -p README-windows-install.txt $installdir/$v/README.txt | ||
| 35 | -mkdir distribution | ||
| 36 | -(cd $installdir; zip -r ../distribution/$v-bin-$tool$wordsize-ci.zip $v) | 33 | +cd build |
| 34 | +../cmake-win $tool ci | ||
| 35 | +cmake --build . -j$(nproc) "${cmake_xargs[@]}" | ||
| 36 | +ctest --verbose "${ctest_xargs[@]}" | ||
| 37 | +cpack -G NSIS -C $config | ||
| 38 | +cpack -G ZIP -C $config | ||
| 39 | +for i in qpdf-*.exe; do | ||
| 40 | + mv $i ../distribution/$(echo $i | sed -e 's/.exe/-ci.exe/') | ||
| 41 | +done | ||
| 42 | +for i in qpdf-*.zip; do | ||
| 43 | + mv $i ../distribution/$(echo $i | sed -e 's/.zip/-ci.zip/') | ||
| 44 | +done | ||
| 45 | +cd .. | ||
| 37 | sha256sum distribution/* | 46 | sha256sum distribution/* |
build-scripts/build-windows.bat
| @@ -10,11 +10,6 @@ if %2 == msvc ( | @@ -10,11 +10,6 @@ if %2 == msvc ( | ||
| 10 | choco install zip | 10 | choco install zip |
| 11 | bash ./build-scripts/build-windows %1 %2 | 11 | bash ./build-scripts/build-windows %1 %2 |
| 12 | ) else ( | 12 | ) else ( |
| 13 | - if exist C:\msys64 ( | ||
| 14 | - set MSYS=C:\msys64 | ||
| 15 | - ) else ( | ||
| 16 | - choco install msys2 | ||
| 17 | - set MSYS=C:\tools\msys64 | ||
| 18 | - ) | ||
| 19 | - !MSYS!\usr\bin\env.exe MSYSTEM=MINGW64 /bin/bash -l %CD%/build-scripts/build-windows %1 %2 | 13 | + set MSYS=C:\msys64 |
| 14 | + !MSYS!\usr\bin\env.exe MSYSTEM=MINGW64 MSYS2_PATH_TYPE=inherit /bin/bash -l %CD%/build-scripts/build-windows %1 %2 | ||
| 20 | ) | 15 | ) |