appveyor.yml 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  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: NO
  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. matrix:
  18. - compiler: gcc-4.9.2-posix
  19. build_shared: NO
  20. - compiler: gcc-4.9.2-posix
  21. build_shared: YES
  22. - compiler: msvc-18-seh
  23. build_shared: NO
  24. - compiler: msvc-18-seh
  25. build_shared: YES
  26. install:
  27. # Derive some extra information
  28. - set build_type=%configuration%
  29. - for /f "tokens=1-3 delims=-" %%a in ("%compiler%") do (@set "compiler_name=%%a")
  30. - for /f "tokens=1-3 delims=-" %%a in ("%compiler%") do (@set "compiler_version=%%b")
  31. - for /f "tokens=1-3 delims=-" %%a in ("%compiler%") do (@set "compiler_threading=%%c")
  32. - if "%platform%"=="x64" (set arch=x86_64)
  33. - if "%platform%"=="x86" (set arch=i686)
  34. # Download the specific version of MinGW
  35. - if "%compiler_name%"=="gcc" (@set "mingw_output_folder=C:\mingw-builds")
  36. - if "%compiler_name%"=="gcc" (
  37. @for /f %%a in (
  38. 'call mingw.cmd
  39. /version "%compiler_version%"
  40. /arch "%arch%"
  41. /threading "%compiler_threading%"
  42. "%mingw_output_folder%"'
  43. ) do @set "compiler_path=%%a"
  44. )
  45. - if "%compiler_name%"=="gcc" (@set "mingw_log_folder=%mingw_output_folder%\logs")
  46. - 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"
  47. - if exist "%mingw_log_file%" appveyor PushArtifact "%mingw_log_file%" -FileName mingw-download.log
  48. before_build:
  49. # Set up mingw commands
  50. - if "%compiler_name%"=="gcc" (set "generator=MinGW Makefiles")
  51. - if "%compiler_name%"=="gcc" (set "build=mingw32-make -j4")
  52. - if "%compiler_name%"=="gcc" (set "test=mingw32-make CTEST_OUTPUT_ON_FAILURE=1 test")
  53. # MSVC specific commands
  54. - if "%compiler_version%"=="14" (set "vs_version=8" & set "vs_year=2005")
  55. - if "%compiler_version%"=="15" (set "vs_version=9" & set "vs_year=2008")
  56. - if "%compiler_version%"=="16" (set "vs_version=10" & set "vs_year=2010")
  57. - if "%compiler_version%"=="17" (set "vs_version=11" & set "vs_year=2012")
  58. - if "%compiler_version%"=="18" (set "vs_version=12" & set "vs_year=2013")
  59. - if "%compiler_version%"=="19" (set "vs_version=14" & set "vs_year=2015")
  60. - if "%compiler_name%"=="msvc" (set "generator=Visual Studio %vs_version% %vs_year%")
  61. - if "%compiler_name%"=="msvc" (
  62. if "%platform%"=="x64" (
  63. set "generator=%generator% Win64"
  64. )
  65. )
  66. - if %compiler_version% gtr 9 (set platform=%platform:x86=Win32%)
  67. - if "%compiler_name%"=="msvc" (set "msbuild_opts=/clp:OnlyErrors;OnlyWarnings /nologo /m /v:m")
  68. - if "%compiler_name%"=="msvc" (set "build=msbuild %msbuild_opts% /p:Configuration=%configuration% /p:Platform=%platform% civetweb.sln")
  69. - if "%compiler_name%"=="msvc" (set "test=msbuild %msbuild_opts% RUN_TESTS.vcxproj")
  70. # Add the compiler path if needed
  71. - if not "%compiler_path%"=="" (set "PATH=%PATH%;%compiler_path%")
  72. # git bash conflicts with MinGW makefiles
  73. - if "%generator%"=="MinGW Makefiles" (set "PATH=%PATH:C:\Program Files (x86)\Git\bin=%")
  74. # Useful locations
  75. - set "source_path=%cd%"
  76. - set "output_path=%source_path%\output"
  77. - set "build_path=%output_path%\build"
  78. - set "install_path=%output_path%\install"
  79. # Generate the build files
  80. - mkdir "%build_path%"
  81. - cd "%build_path%"
  82. - cmake --version
  83. - appveyor AddMessage -Category Information "Generating '%generator%'"
  84. - cmake
  85. -G "%generator%"
  86. -DCMAKE_BUILD_TYPE=%build_type%
  87. -DBUILD_SHARED_LIBS=%build_shared%
  88. -DCIVETWEB_ENABLE_SSL=%enable_ssl%
  89. -DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=%enable_ssl_dynamic_loading%
  90. -DCIVETWEB_ENABLE_WEBSOCKETS=%enable_websockets%
  91. -DCIVETWEB_ENABLE_CXX=%enable_cxx%
  92. -DCIVETWEB_ENABLE_LUA=%enable_lua%
  93. -DCIVETWEB_ENABLE_LUA_SHARED=%enable_lua_shared%
  94. -DCIVETWEB_C_STANDARD=%c_standard%
  95. -DCIVETWEB_CXX_STANDARD=%cxx_standard%
  96. "%source_path%"
  97. - appveyor PushArtifact CMakeCache.txt
  98. - cd "%source_path%"
  99. build_script:
  100. - cd "%build_path%"
  101. - appveyor AddMessage -Category Information "Build command '%build%'"
  102. - cmd /c "%build%"
  103. - cd "%source_path%"
  104. test_script:
  105. - cd "%build_path%"
  106. - appveyor AddMessage -Category Information "Test command '%build%'"
  107. - cmd /c "%test%"
  108. - cd "%source_path%"
  109. after_test:
  110. - cmake "-DCMAKE_INSTALL_PREFIX=%install_path%" -P "%build_path%/cmake_install.cmake"
  111. matrix:
  112. fast_finish: true
  113. cache:
  114. - C:\mingw-builds -> mingw.cmd