appveyor.yml 7.7 KB

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