appveyor.yml 8.9 KB

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