appveyor.yml 5.7 KB

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