appveyor.yml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291
  1. version: '{build}'
  2. build:
  3. # no automatic build in script mode
  4. platform:
  5. - x86
  6. - x64
  7. skip_commits:
  8. # Builds just testing something on Travis CI don't need to be
  9. # done on AppVeyor
  10. message: /\[Travis\]/
  11. # Dont build, if only documentation was changed
  12. files:
  13. - '**/*.md'
  14. environment:
  15. enable_cxx: NO
  16. enable_ssl_dynamic_loading: YES
  17. enable_lua: NO
  18. enable_lua_shared: NO
  19. c_standard: auto
  20. cxx_standard: auto
  21. matrix:
  22. - id: 1
  23. compiler: msvc-18-seh
  24. build_shared: NO
  25. no_files: NO
  26. enable_ipv6: NO
  27. enable_ssl: YES
  28. enable_websockets: YES
  29. no_cgi: NO
  30. no_caching: NO
  31. configuration: Release
  32. - id: 2
  33. compiler: msvc-18-seh
  34. build_shared: YES
  35. no_files: NO
  36. enable_ipv6: NO
  37. enable_ssl: YES
  38. enable_websockets: YES
  39. no_cgi: NO
  40. no_caching: NO
  41. configuration: Release
  42. - id: 3
  43. compiler: msvc-18-seh
  44. build_shared: YES
  45. no_files: YES
  46. enable_ipv6: NO
  47. enable_ssl: YES
  48. enable_websockets: YES
  49. no_cgi: NO
  50. no_caching: NO
  51. configuration: Release
  52. - id: 4
  53. compiler: gcc-5.1.0-posix
  54. build_shared: NO
  55. no_files: YES
  56. enable_ipv6: NO
  57. enable_ssl: NO
  58. enable_websockets: NO
  59. no_cgi: YES
  60. no_caching: YES
  61. configuration: Release
  62. - id: 5
  63. compiler: gcc-5.1.0-posix
  64. build_shared: NO
  65. no_files: NO
  66. enable_ipv6: YES
  67. enable_ssl: YES
  68. enable_websockets: YES
  69. no_cgi: NO
  70. no_caching: YES
  71. configuration: Release
  72. - id: 6
  73. compiler: gcc-5.1.0-posix
  74. build_shared: NO
  75. no_files: NO
  76. enable_ipv6: NO
  77. enable_ssl: YES
  78. enable_websockets: YES
  79. no_cgi: NO
  80. no_caching: YES
  81. configuration: Release
  82. - id: 7
  83. compiler: gcc-5.1.0-posix
  84. build_shared: YES
  85. no_files: NO
  86. enable_ipv6: NO
  87. enable_ssl: YES
  88. enable_websockets: YES
  89. no_cgi: NO
  90. no_caching: YES
  91. configuration: Release
  92. - id: 8
  93. compiler: gcc-5.1.0-posix
  94. build_shared: YES
  95. no_files: YES
  96. enable_ipv6: NO
  97. enable_ssl: YES
  98. enable_websockets: YES
  99. no_cgi: NO
  100. no_caching: YES
  101. configuration: Release
  102. - id: 9
  103. compiler: msvc-18-seh
  104. build_shared: NO
  105. no_files: NO
  106. enable_ipv6: YES
  107. enable_ssl: YES
  108. enable_websockets: YES
  109. no_cgi: NO
  110. no_caching: NO
  111. configuration: Debug
  112. - id: 10
  113. compiler: msvc-16-seh
  114. build_shared: NO
  115. no_files: NO
  116. enable_ipv6: YES
  117. enable_ssl: YES
  118. enable_websockets: YES
  119. no_cgi: NO
  120. no_caching: NO
  121. configuration: Release
  122. - id: 11
  123. compiler: msvc-17-seh
  124. build_shared: NO
  125. no_files: NO
  126. enable_ipv6: YES
  127. enable_ssl: YES
  128. enable_websockets: YES
  129. no_cgi: NO
  130. no_caching: NO
  131. configuration: Release
  132. - id: 12
  133. compiler: msvc-19-seh
  134. build_shared: NO
  135. no_files: NO
  136. enable_ipv6: YES
  137. enable_ssl: YES
  138. enable_websockets: YES
  139. no_cgi: NO
  140. no_caching: NO
  141. configuration: Release
  142. install:
  143. # Derive some extra information
  144. - set build_type=%configuration%
  145. - for /f "tokens=1-3 delims=-" %%a in ("%compiler%") do (@set "compiler_name=%%a")
  146. - for /f "tokens=1-3 delims=-" %%a in ("%compiler%") do (@set "compiler_version=%%b")
  147. - for /f "tokens=1-3 delims=-" %%a in ("%compiler%") do (@set "compiler_threading=%%c")
  148. - if "%platform%"=="x64" (set arch=x86_64)
  149. - if "%platform%"=="x86" (set arch=i686)
  150. # Download the specific version of MinGW
  151. - if "%compiler_name%"=="gcc" (@set "mingw_output_folder=C:\mingw-builds")
  152. - if "%compiler_name%"=="gcc" (
  153. @for /f %%a in (
  154. 'call mingw.cmd
  155. /version "%compiler_version%"
  156. /arch "%arch%"
  157. /threading "%compiler_threading%"
  158. "%mingw_output_folder%"'
  159. ) do @set "compiler_path=%%a"
  160. )
  161. - if "%compiler_name%"=="gcc" (@set "mingw_log_folder=%mingw_output_folder%\logs")
  162. - if exist "%mingw_log_folder%" @for /f %%f in ('dir /b /oD /tc "%mingw_log_folder%"') do @set "mingw_log_file=%mingw_log_folder%\%%f"
  163. - if exist "%mingw_log_file%" powershell Push-AppveyorArtifact "%mingw_log_file%" -FileName mingw-download.log
  164. # Get OpenSSL
  165. #
  166. # OpenSSL should already be installed, according to
  167. # - http://help.appveyor.com/discussions/questions/1132-openssl-installation-issues
  168. # - https://github.com/appveyor/ci/issues/576
  169. #
  170. - cmd: set PATH=%PATH%;C:\OpenSSL-Win32;C:\OpenSSL-Win64
  171. - dir C:\OpenSSL-Win32
  172. - dir C:\OpenSSL-Win64
  173. - path
  174. before_build:
  175. # Remove sh.exe from the path otherwise CMake will complain:
  176. # "sh.exe was found in your PATH, here: C:/Program Files/Git/usr/bin/sh.exe"
  177. # and the MinGW build will not work (the Visual Studio build does not care).
  178. # See http://help.appveyor.com/discussions/problems/3193-cmake-building-for-mingw-issue-with-git-shexe
  179. # The entire directory containing sh.exe could be removed from the PATH environment:
  180. # - set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
  181. # However, this will also remove all other programs in this directory from the PATH.
  182. # In particular "patch" is still required.
  183. # So, just rename sh.exe:
  184. - ren "C:\Program Files\Git\usr\bin\sh.exe" _sh.exe
  185. # Set up mingw commands
  186. - if "%compiler_name%"=="gcc" (set "generator=MinGW Makefiles")
  187. - if "%compiler_name%"=="gcc" (set "build=mingw32-make -j4")
  188. - if "%compiler_name%"=="gcc" (set "test=mingw32-make test")
  189. # MSVC specific commands
  190. # Note: The minimum version officially supported for CivetWeb is VS2010. Older ones might work or not.
  191. - if "%compiler_version%"=="14" (set "vs_version=8" & set "vs_year=2005")
  192. - if "%compiler_version%"=="15" (set "vs_version=9" & set "vs_year=2008")
  193. - if "%compiler_version%"=="16" (set "vs_version=10" & set "vs_year=2010")
  194. - if "%compiler_version%"=="17" (set "vs_version=11" & set "vs_year=2012")
  195. - if "%compiler_version%"=="18" (set "vs_version=12" & set "vs_year=2013")
  196. - if "%compiler_version%"=="19" (set "vs_version=14" & set "vs_year=2015")
  197. - if "%compiler_name%"=="msvc" (set "generator=Visual Studio %vs_version% %vs_year%")
  198. - if "%compiler_name%"=="msvc" (
  199. if "%platform%"=="x64" (
  200. set "generator=%generator% Win64"
  201. )
  202. )
  203. - if %compiler_version% gtr 9 (set platform=%platform:x86=Win32%)
  204. - if "%compiler_name%"=="msvc" (set "msbuild_opts=/clp:OnlyErrors;OnlyWarnings /nologo /m /v:m")
  205. - if "%compiler_name%"=="msvc" (set "build=msbuild %msbuild_opts% /p:Configuration=%configuration% /p:Platform=%platform% civetweb.sln")
  206. - if "%compiler_name%"=="msvc" (set "test=msbuild %msbuild_opts% RUN_TESTS.vcxproj")
  207. # Add the compiler path if needed
  208. - if not "%compiler_path%"=="" (set "PATH=%PATH%;%compiler_path%")
  209. # git bash conflicts with MinGW makefiles
  210. - if "%generator%"=="MinGW Makefiles" (set "PATH=%PATH:C:\Program Files (x86)\Git\bin=%")
  211. # Useful locations
  212. - set "source_path=%cd%"
  213. - set "output_path=%source_path%\output"
  214. - set "build_path=%output_path%\build"
  215. - set "install_path=%output_path%\install"
  216. - set "third_party_dir=C:\third-party"
  217. # Check some settings of the build server
  218. - ver
  219. - cd
  220. - dir
  221. - ipconfig /all
  222. # Generate the build scripts with CMake
  223. - mkdir "%build_path%"
  224. - cd "%build_path%"
  225. - cmake --version
  226. - appveyor AddMessage -Category Information "Generating '%generator%'"
  227. - cmake
  228. -G "%generator%"
  229. -DCMAKE_BUILD_TYPE=%build_type%
  230. -DBUILD_SHARED_LIBS=%build_shared%
  231. -DCIVETWEB_SERVE_NO_FILES=%no_files%
  232. "-DCIVETWEB_THIRD_PARTY_DIR=%third_party_dir:\=\\%"
  233. -DCIVETWEB_ENABLE_THIRD_PARTY_OUTPUT=YES
  234. -DCIVETWEB_ENABLE_SSL=%enable_ssl%
  235. -DCIVETWEB_DISABLE_CGI=%no_cgi%
  236. -DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=%enable_ssl_dynamic_loading%
  237. -DCIVETWEB_ENABLE_WEBSOCKETS=%enable_websockets%
  238. -DCIVETWEB_ENABLE_CXX=%enable_cxx%
  239. -DCIVETWEB_ENABLE_LUA=%enable_lua%
  240. -DCIVETWEB_ENABLE_LUA_SHARED=%enable_lua_shared%
  241. -DCIVETWEB_DISABLE_CACHING=%no_caching%
  242. -DCIVETWEB_C_STANDARD=%c_standard%
  243. -DCIVETWEB_CXX_STANDARD=%cxx_standard%
  244. "%source_path%"
  245. - powershell Push-AppveyorArtifact CMakeCache.txt
  246. - cd "%source_path%"
  247. build_script:
  248. - cd
  249. - cd "%build_path%"
  250. - appveyor AddMessage -Category Information "Build command '%build%'"
  251. - cmd /c "%build%"
  252. - cd "%source_path%"
  253. test_script:
  254. - cd "%build_path%"
  255. - appveyor AddMessage -Category Information "Test command '%build%'"
  256. - set CTEST_OUTPUT_ON_FAILURE=1
  257. - cmd /c "%test%"
  258. - cd "%source_path%"
  259. after_test:
  260. - cd
  261. - dir
  262. - md dist
  263. - if "%build_type%"=="Release" (cmake "-DCMAKE_INSTALL_PREFIX=%install_path%" -P "%build_path%/cmake_install.cmake")
  264. - if "%build_type%"=="Release" (copy "%build_path%" dist\)
  265. - dir dist\
  266. matrix:
  267. fast_finish: false
  268. cache:
  269. - C:\mingw-builds -> mingw.cmd
  270. - C:\third-party -> **\CMakeLists.txt
  271. - C:\ssl
  272. artifacts:
  273. - path: dist\*