appveyor.yml 7.5 KB

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