appveyor.yml 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252
  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. install:
  106. # Derive some extra information
  107. - set build_type=%configuration%
  108. - for /f "tokens=1-3 delims=-" %%a in ("%compiler%") do (@set "compiler_name=%%a")
  109. - for /f "tokens=1-3 delims=-" %%a in ("%compiler%") do (@set "compiler_version=%%b")
  110. - for /f "tokens=1-3 delims=-" %%a in ("%compiler%") do (@set "compiler_threading=%%c")
  111. - if "%platform%"=="x64" (set arch=x86_64)
  112. - if "%platform%"=="x86" (set arch=i686)
  113. # Download the specific version of MinGW
  114. - if "%compiler_name%"=="gcc" (@set "mingw_output_folder=C:\mingw-builds")
  115. - if "%compiler_name%"=="gcc" (
  116. @for /f %%a in (
  117. 'call mingw.cmd
  118. /version "%compiler_version%"
  119. /arch "%arch%"
  120. /threading "%compiler_threading%"
  121. "%mingw_output_folder%"'
  122. ) do @set "compiler_path=%%a"
  123. )
  124. - if "%compiler_name%"=="gcc" (@set "mingw_log_folder=%mingw_output_folder%\logs")
  125. - 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"
  126. - if exist "%mingw_log_file%" powershell Push-AppveyorArtifact "%mingw_log_file%" -FileName mingw-download.log
  127. # Get OpenSSL
  128. #
  129. # OpenSSL should already be installed, according to
  130. # - http://help.appveyor.com/discussions/questions/1132-openssl-installation-issues
  131. # - https://github.com/appveyor/ci/issues/576
  132. #
  133. - cmd: set PATH=%PATH%;C:\OpenSSL-Win32;C:\OpenSSL-Win64
  134. - dir C:\OpenSSL-Win32
  135. - dir C:\OpenSSL-Win64
  136. - path
  137. before_build:
  138. # Remove sh.exe from the path otherwise CMake will complain:
  139. # "sh.exe was found in your PATH, here: C:/Program Files/Git/usr/bin/sh.exe"
  140. # and the MinGW build will not work (the Visual Studio build does not care).
  141. # See http://help.appveyor.com/discussions/problems/3193-cmake-building-for-mingw-issue-with-git-shexe
  142. # The entire directory containing sh.exe could be removed from the PATH environment:
  143. # - set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
  144. # However, this will also remove all other programs in this directory from the PATH.
  145. # In particular "patch" is still required.
  146. # So, just rename sh.exe:
  147. - ren "C:\Program Files\Git\usr\bin\sh.exe" _sh.exe
  148. # Set up mingw commands
  149. - if "%compiler_name%"=="gcc" (set "generator=MinGW Makefiles")
  150. - if "%compiler_name%"=="gcc" (set "build=mingw32-make -j4")
  151. - if "%compiler_name%"=="gcc" (set "test=mingw32-make test")
  152. # MSVC specific commands
  153. # Note: The minimum version officially supported for CivetWeb is VS2010. Older ones might work or not.
  154. - if "%compiler_version%"=="14" (set "vs_version=8" & set "vs_year=2005")
  155. - if "%compiler_version%"=="15" (set "vs_version=9" & set "vs_year=2008")
  156. - if "%compiler_version%"=="16" (set "vs_version=10" & set "vs_year=2010")
  157. - if "%compiler_version%"=="17" (set "vs_version=11" & set "vs_year=2012")
  158. - if "%compiler_version%"=="18" (set "vs_version=12" & set "vs_year=2013")
  159. - if "%compiler_version%"=="19" (set "vs_version=14" & set "vs_year=2015")
  160. - if "%compiler_name%"=="msvc" (set "generator=Visual Studio %vs_version% %vs_year%")
  161. - if "%compiler_name%"=="msvc" (
  162. if "%platform%"=="x64" (
  163. set "generator=%generator% Win64"
  164. )
  165. )
  166. - if %compiler_version% gtr 9 (set platform=%platform:x86=Win32%)
  167. - if "%compiler_name%"=="msvc" (set "msbuild_opts=/clp:OnlyErrors;OnlyWarnings /nologo /m /v:m")
  168. - if "%compiler_name%"=="msvc" (set "build=msbuild %msbuild_opts% /p:Configuration=%configuration% /p:Platform=%platform% civetweb.sln")
  169. - if "%compiler_name%"=="msvc" (set "test=msbuild %msbuild_opts% RUN_TESTS.vcxproj")
  170. # Add the compiler path if needed
  171. - if not "%compiler_path%"=="" (set "PATH=%PATH%;%compiler_path%")
  172. # git bash conflicts with MinGW makefiles
  173. - if "%generator%"=="MinGW Makefiles" (set "PATH=%PATH:C:\Program Files (x86)\Git\bin=%")
  174. # Useful locations
  175. - set "source_path=%cd%"
  176. - set "output_path=%source_path%\output"
  177. - set "build_path=%output_path%\build"
  178. - set "install_path=%output_path%\install"
  179. - set "third_party_dir=C:\third-party"
  180. # Check some settings of the build server
  181. - ver
  182. - cd
  183. - dir
  184. - ipconfig /all
  185. # Generate the build scripts with CMake
  186. - mkdir "%build_path%"
  187. - cd "%build_path%"
  188. - cmake --version
  189. - appveyor AddMessage -Category Information "Generating '%generator%'"
  190. - cmake
  191. -G "%generator%"
  192. -DCMAKE_BUILD_TYPE=%build_type%
  193. -DBUILD_SHARED_LIBS=%build_shared%
  194. -DCIVETWEB_SERVE_NO_FILES=%no_files%
  195. "-DCIVETWEB_THIRD_PARTY_DIR=%third_party_dir:\=\\%"
  196. -DCIVETWEB_ENABLE_THIRD_PARTY_OUTPUT=YES
  197. -DCIVETWEB_ENABLE_SSL=%enable_ssl%
  198. -DCIVETWEB_DISABLE_CGI=%no_cgi%
  199. -DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=%enable_ssl_dynamic_loading%
  200. -DCIVETWEB_ENABLE_WEBSOCKETS=%enable_websockets%
  201. -DCIVETWEB_ENABLE_CXX=%enable_cxx%
  202. -DCIVETWEB_ENABLE_LUA=%enable_lua%
  203. -DCIVETWEB_ENABLE_LUA_SHARED=%enable_lua_shared%
  204. -DCIVETWEB_DISABLE_CACHING=%no_caching%
  205. -DCIVETWEB_C_STANDARD=%c_standard%
  206. -DCIVETWEB_CXX_STANDARD=%cxx_standard%
  207. "%source_path%"
  208. - powershell Push-AppveyorArtifact CMakeCache.txt
  209. - cd "%source_path%"
  210. build_script:
  211. - cd
  212. - cd "%build_path%"
  213. - appveyor AddMessage -Category Information "Build command '%build%'"
  214. - cmd /c "%build%"
  215. - cd "%source_path%"
  216. test_script:
  217. - cd "%build_path%"
  218. - appveyor AddMessage -Category Information "Test command '%build%'"
  219. - set CTEST_OUTPUT_ON_FAILURE=1
  220. - cmd /c "%test%"
  221. - cd "%source_path%"
  222. after_test:
  223. - cd
  224. - dir
  225. - md dist
  226. - if "%build_type%"=="Release" (cmake "-DCMAKE_INSTALL_PREFIX=%install_path%" -P "%build_path%/cmake_install.cmake")
  227. - if "%build_type%"=="Release" (copy "%build_path%" dist\)
  228. - dir dist\
  229. matrix:
  230. fast_finish: false
  231. cache:
  232. - C:\mingw-builds -> mingw.cmd
  233. - C:\third-party -> **\CMakeLists.txt
  234. - C:\ssl
  235. artifacts:
  236. - path: dist\*