appveyor.yml 7.6 KB

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