appveyor.yml 7.0 KB

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