appveyor.yml 7.6 KB

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