Stop defining __MSVCRT_VERSION__
[xapian.git] / .appveyor.yml
blob54123953df034a6afa020ec019fcffdef14c50b9
1 skip_tags: true
2 # A full clone takes 30 seconds, depth 20 takes 5 seconds.
4 # Using "shallow_clone: true" downloads the commit as a ZIP file so you might
5 # think that would be quicker still, but actually it seems to take ~15 seconds,
6 # and then bootstrap fails due to there not being a ".git" directory.
7 clone_depth: 20
8 # Specify clone_folder so we can hard-code the Unix path equivalent below.
9 clone_folder: c:\projects\xapian
10 environment:
11   global:
12     AUTOMATED_TESTING: 1
13   matrix:
14 # Disable for now as package download is currently failing:
16 # mingw-get.exe: *** ERROR *** http://osdn.net/dl/mingw/libz-1.2.11-1-mingw32-dev.tar.xz:cannot open URL; status = 12002
18 #   - TOOLCHAIN: mingw
19 #     platform: x86
20 #     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
21   - TOOLCHAIN: mingw64
22     platform: x86
23     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
24   - TOOLCHAIN: mingw64
25     platform: x64
26     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
27   - TOOLCHAIN: msvc
28     platform: x86
29     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
30     VCVARS_BAT: "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvars32.bat\""
31   - TOOLCHAIN: msvc
32     platform: x64
33     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
34     VCVARS_BAT: "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\""
35   - TOOLCHAIN: msvc
36     platform: x86
37     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
38     VCVARS_BAT: "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvars32.bat\""
39   - TOOLCHAIN: msvc
40     platform: x64
41     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
42     VCVARS_BAT: "\"C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\""
43   - TOOLCHAIN: msvc
44     platform: x86
45     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
46     VCVARS_BAT: "\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars32.bat\""
47   - TOOLCHAIN: msvc
48     platform: x64
49     APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2022
50     VCVARS_BAT: "\"C:\\Program Files\\Microsoft Visual Studio\\2022\\Community\\VC\\Auxiliary\\Build\\vcvars64.bat\""
51 install:
52   - ps: >-
53       $env:CONFIGOPTS="--disable-documentation"
54   - ps: >-
55       if ($env:TOOLCHAIN -eq "mingw") {
56         $env:PATH="C:\Mingw\bin;C:\Mingw\MSYS\1.0\bin;$env:PATH"
57       } elseif ($env:TOOLCHAIN -eq "mingw64") {
58         if ($env:Platform -eq "x86") {
59           $env:PATH="C:\mingw-w64\i686-8.1.0-posix-dwarf-rt_v6-rev0\mingw32\bin;C:\msys64\usr\bin;$env:PATH"
60           $env:CONFIGOPTS+=" --host=i686-pc-mingw32"
61         } else {
62           $env:PATH="C:\mingw-w64\x86_64-8.1.0-posix-seh-rt_v6-rev0\mingw64\bin;C:\msys64\usr\bin;$env:PATH"
63           $env:CONFIGOPTS+=" --host=x86_64-w64-mingw32"
64         }
65       } elseif ($env:TOOLCHAIN -eq "llvm") {
66         $env:PATH="C:\Program Files\LLVM\bin;c:\msys64\usr\bin;$env:PATH"
67       } else {
68         $env:PATH="c:\msys64\usr\bin;$env:PATH"
69       }
70   - if "%TOOLCHAIN%"=="mingw" bash -c "echo 'c:/mingw /mingw' >> /etc/fstab"
71   - if "%TOOLCHAIN%"=="mingw" appveyor-retry bash -c 'mingw-get install libz-dev'
72   - if "%TOOLCHAIN%"=="mingw64" appveyor-retry bash -c 'pacman -Sy --noconfirm zlib-devel'
73   - bash -c 'time ./bootstrap --fetch-url-command="curl --retry 5 --retry-connrefused -L" xapian-core'
74   - if defined VCVARS_BAT call %VCVARS_BAT%
75   - if "%TOOLCHAIN%"=="msvc" mkdir zlib
76   - if "%TOOLCHAIN%"=="msvc" cd zlib
77   - if "%TOOLCHAIN%"=="msvc" bash -c 'curl --retry 5 --retry-connrefused -L https://github.com/xapian/xapian-dev-deps/releases/download/current/zlib-1.2.13.tar.gz|tar --strip-components=1 -zxf -'
78   # Don't build zlib with -MD as it seems this flag needs to be used
79   # consistently across the build.
80   - if "%TOOLCHAIN%"=="msvc" sed -i 's/\(^CFLAGS  *= *-nologo \)-MD /\1/' win32/Makefile.msc
81   # Don't build zlib with a fixed base address on x64 as that gives linker
82   # warning LNK4281.
83   - if "%TOOLCHAIN%-%Platform%"=="msvc-x64" sed -i 's/-base:0x[0-9A-Fa-f]* //' win32/Makefile.msc
84   - if "%TOOLCHAIN%"=="msvc" nmake -nologo -f win32\Makefile.msc
85   - if "%TOOLCHAIN%"=="msvc" cd ..
86   # Fetch pre-built unicode-data.cc to avoid having to get working tclsh.
87   - curl --retry 5 --retry-connrefused https://oligarchy.co.uk/xapian/patches/unicode-data15.cc > xapian-core\unicode\unicode-data.cc
88   - ps: >-
89       if ($env:TOOLCHAIN -eq "msvc") {
90         $env:CC="cl -nologo"
91         $env:CXX="c:/projects/xapian/INST/share/automake-1.16/compile cl -nologo"
92         $env:CXXFLAGS="-EHsc"
93         $env:CPPFLAGS="-Ic:/projects/xapian/zlib"
94         $env:AR="lib"
95         $env:LDFLAGS="-Lc:/projects/xapian/zlib"
96       }
97 build_script:
98   - bash -c 'time ./configure $CONFIGOPTS'
99   - bash -c 'time make -j2' < nul
100 test_script:
101   - bash -c 'time make check VERBOSE=1' < nul