summaryrefslogtreecommitdiff
path: root/.appveyor.yml
blob: 9a8fa19792a21d5c332d2890163fa1afbf8de97c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
environment:
  AV_PROJECTS: 'c:\projects'
  AV_TIFF_DOWNLOAD: 'c:\projects\download'
  AV_TIFF_SOURCE: 'c:\projects\libtiff'
  AV_TIFF_BUILD: 'c:\projects\build'
  AV_TIFF_INSTALL: 'c:\projects\install'

  matrix:
    - compiler: cygwin-cmake
      configuration: Release
      generator: Unix Makefiles
      shared: ON
    - compiler: cygwin-cmake
      configuration: Debug
      generator: Unix Makefiles
      shared: OFF
    - compiler: mingw-cmake
      configuration: Release
      generator: MinGW Makefiles
      shared: ON
    - compiler: mingw-cmake
      configuration: Debug
      generator: MinGW Makefiles
      shared: OFF
    - compiler: vc14-cmake
      configuration: Release
      arch: x64
      generator: Visual Studio 16 2019
      shared: ON
    - compiler: vc14-cmake
      configuration: Debug
      arch: Win32
      generator: Visual Studio 16 2019
      shared: OFF


cache:
  #- 'c:\projects\download -> appveyor.yml'

# Operating system (build VM template)
os: 'Visual Studio 2019'

# clone directory
clone_folder: 'c:\projects\libtiff'
clone_depth: 5

platform: x64

init:
  - git config --global core.autocrlf input

before_build:
  - 'FOR /F "tokens=* USEBACKQ" %%F IN (`C:\cygwin64\bin\cygpath -u %AV_TIFF_SOURCE%`) DO SET AV_TIFF_CYG_SOURCE=%%F'
  - 'FOR /F "tokens=* USEBACKQ" %%F IN (`C:\cygwin64\bin\cygpath -u %AV_TIFF_INSTALL%`) DO SET AV_TIFF_CYG_INSTALL=%%F'
  - 'if %compiler%==cygwin-cmake C:\cygwin64\setup-x86_64 -q -R C:\cygwin64 -s http://cygwin.mirror.constant.com -l %AV_TIFF_DOWNLOAD%\cygwin -P cmake,libjpeg-devel,zlib-devel'
  - 'if %compiler%==cygwin-cmake set "PATH=C:\cygwin64\bin;%PATH%"'
  - set
  - 'if %compiler%==cygwin-cmake cygpath --version || echo cygpath not found'
  - 'if %compiler%==cygwin-cmake cmake --version || echo CMake not found'
  - set "AV_CMAKE_ARGS=-DBUILD_SHARED_LIBS:BOOL=%shared%"
  - 'if %compiler%==cygwin-cmake set "AV_CMAKE_ARGS=%AV_CMAKE_ARGS% -Dfatal-warnings=ON"'
  - 'if %compiler%==mingw32-cmake set "AV_CMAKE_ARGS=%AV_CMAKE_ARGS% -Dfatal-warnings=ON"'
  - set "AV_TIFF_CMAKE_SOURCE=%AV_TIFF_SOURCE%"
  - set "AV_TIFF_CMAKE_INSTALL=%AV_TIFF_INSTALL%"
  - 'if %compiler%==cygwin-cmake set "AV_TIFF_CMAKE_SOURCE=%AV_TIFF_CYG_SOURCE%'
  - 'if %compiler%==cygwin-cmake set "AV_TIFF_CMAKE_INSTALL=%AV_TIFF_CYG_INSTALL%'
  - 'if %compiler%==mingw-cmake set "PATH=C:\MinGW\bin;%PATH%"'
  - mkdir %AV_TIFF_BUILD%
  - cd %AV_TIFF_BUILD%
  - echo Running cmake -G "%generator%" -DCMAKE_INSTALL_PREFIX=%AV_TIFF_CMAKE_INSTALL% -DCMAKE_BUILD_TYPE=%configuration% %AV_TIFF_CMAKE_SOURCE%
  - 'if %compiler%==cygwin-cmake bash -c "cmake -G \"%generator%\" -DCMAKE_INSTALL_PREFIX:PATH=%AV_TIFF_CMAKE_INSTALL% -DCMAKE_BUILD_TYPE=%configuration% %AV_CMAKE_ARGS% %AV_TIFF_CMAKE_SOURCE%"'
  - 'if %compiler%==mingw-cmake cmake -G "%generator%" -DCMAKE_INSTALL_PREFIX:PATH=%AV_TIFF_CMAKE_INSTALL% -DCMAKE_BUILD_TYPE=%configuration% %AV_CMAKE_ARGS% %AV_TIFF_CMAKE_SOURCE%'
  - 'if %compiler%==vc14-cmake cmake -G "%generator%" -A %arch% -DCMAKE_INSTALL_PREFIX:PATH=%AV_TIFF_CMAKE_INSTALL% -DCMAKE_BUILD_TYPE=%configuration% %AV_CMAKE_ARGS% %AV_TIFF_CMAKE_SOURCE%'

build_script:
  - cd %AV_TIFF_BUILD%
  - 'if %compiler%==cygwin-cmake bash -c "cmake --build . --config %configuration% --target install"'
  - 'if %compiler%==mingw-cmake cmake --build . --config %configuration% --target install'
  - 'if %compiler%==vc14-cmake cmake --build . --config %configuration% --target install'
  - 'if %compiler%==vc9-cmake cmake --build . --config %configuration% --target install'

# scripts to run after build
after_build:
  - cd %AV_TIFF_BUILD%
  - '7z a %AV_TIFF_SOURCE%\libtiff-build.zip * -tzip'
  - cd %AV_TIFF_INSTALL%
  - '7z a %AV_TIFF_SOURCE%\libtiff.zip * -tzip'

before_test:
  - cd %AV_TIFF_BUILD%
  - 'if %compiler%==cygwin-cmake bash -c "ctest -V -C %configuration%"'
  - 'if %compiler%==mingw-cmake ctest -V -C %configuration%'
  - 'if %compiler%==vc14-cmake ctest -V -C %configuration%'
  - 'if %compiler%==vc9-cmake ctest -V -C %configuration%'

# AppVeyor don't yet have a configurable retention policy, so this will
# eventually use up all the storage allowance.
#artifacts:
#  - path: libtiff.zip
#    name: libtiff.zip
#  - path: libtiff-build.zip
#    name: libtiff-build.zip