appveyor.yml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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" (
  36. for /f %%a in (
  37. 'call mingw.cmd
  38. /version "%compiler_version%"
  39. /arch "%arch%"
  40. /threading "%compiler_threading%"
  41. "C:\mingw-builds"'
  42. ) do @set "compiler_path=%%a"
  43. )
  44. before_build:
  45. # Set up mingw commands
  46. - if "%compiler_name%"=="gcc" (set "generator=MinGW Makefiles")
  47. - if "%compiler_name%"=="gcc" (set "build=mingw32-make -j4")
  48. - if "%compiler_name%"=="gcc" (set "test=mingw32-make CTEST_OUTPUT_ON_FAILURE=1 test")
  49. # MSVC specific commands
  50. - if "%compiler_version%"=="14" (set "vs_version=8" & set "vs_year=2005")
  51. - if "%compiler_version%"=="15" (set "vs_version=9" & set "vs_year=2008")
  52. - if "%compiler_version%"=="16" (set "vs_version=10" & set "vs_year=2010")
  53. - if "%compiler_version%"=="17" (set "vs_version=11" & set "vs_year=2012")
  54. - if "%compiler_version%"=="18" (set "vs_version=12" & set "vs_year=2013")
  55. - if "%compiler_version%"=="19" (set "vs_version=14" & set "vs_year=2015")
  56. - if "%compiler_name%"=="msvc" (set "generator=Visual Studio %vs_version% %vs_year%")
  57. - if "%compiler_name%"=="msvc" (
  58. if "%platform%"=="x64" (
  59. set "generator=%generator% Win64"
  60. )
  61. )
  62. - if %compiler_version% gtr 9 (set platform=%platform:x86=Win32%)
  63. - if "%compiler_name%"=="msvc" (set "msbuild_opts=/clp:OnlyErrors;OnlyWarnings /nologo /m /v:m")
  64. - if "%compiler_name%"=="msvc" (set "build=msbuild %msbuild_opts% /p:Configuration=%configuration% /p:Platform=%platform% civetweb.sln")
  65. - if "%compiler_name%"=="msvc" (set "test=msbuild %msbuild_opts% RUN_TESTS.vcxproj")
  66. # Add the compiler path if needed
  67. - if not "%compiler_path%"=="" (set "PATH=%PATH%;%compiler_path%")
  68. # git bash conflicts with MinGW makefiles
  69. - if "%generator%"=="MinGW Makefiles" (set "PATH=%PATH:C:\Program Files (x86)\Git\bin=%")
  70. # Generate the build files
  71. - mkdir output
  72. - cd output
  73. - cmake --version
  74. - appveyor AddMessage -Category Information "Generating '%generator%'"
  75. - cmake
  76. -G "%generator%"
  77. -DCMAKE_BUILD_TYPE=%build_type%
  78. -DBUILD_SHARED_LIBS=%build_shared%
  79. -DCIVETWEB_ENABLE_SSL=%enable_ssl%
  80. -DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=%enable_ssl_dynamic_loading%
  81. -DCIVETWEB_ENABLE_WEBSOCKETS=%enable_websockets%
  82. -DCIVETWEB_ENABLE_CXX=%enable_cxx%
  83. -DCIVETWEB_ENABLE_LUA=%enable_lua%
  84. -DCIVETWEB_ENABLE_LUA_SHARED=%enable_lua_shared%
  85. -DCIVETWEB_C_STANDARD=%c_standard%
  86. -DCIVETWEB_CXX_STANDARD=%cxx_standard%
  87. ..
  88. build_script:
  89. - appveyor AddMessage -Category Information "Build command '%build%'"
  90. - cmd /c "%build%"
  91. test_script:
  92. - appveyor AddMessage -Category Information "Test command '%build%'"
  93. - cmd /c "%test%"
  94. matrix:
  95. fast_finish: true
  96. cache:
  97. - C:\mingw-builds -> mingw.cmd