appveyor.yml 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  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. # Use default values
  20. - id: Default-x86
  21. compiler: msvc-19-seh
  22. build_shared: NO
  23. no_files: NO
  24. enable_ipv6: NO
  25. enable_ssl: YES
  26. enable_websockets: NO
  27. no_cgi: NO
  28. no_caching: NO
  29. enable_stats: NO
  30. configuration: Release
  31. platform: x86
  32. - id: Default-x64
  33. compiler: msvc-19-seh
  34. build_shared: NO
  35. no_files: NO
  36. enable_ipv6: NO
  37. enable_ssl: YES
  38. enable_websockets: NO
  39. no_cgi: NO
  40. no_caching: NO
  41. enable_stats: NO
  42. configuration: Release
  43. platform: x64
  44. # Use default values
  45. - id: Full-x86
  46. compiler: msvc-19-seh
  47. build_shared: NO
  48. no_files: NO
  49. enable_ipv6: YES
  50. enable_ssl: YES
  51. enable_websockets: YES
  52. no_cgi: NO
  53. no_caching: NO
  54. enable_stats: YES
  55. configuration: Release
  56. platform: x86
  57. - id: Full-x64
  58. compiler: msvc-19-seh
  59. build_shared: NO
  60. no_files: NO
  61. enable_ipv6: YES
  62. enable_ssl: YES
  63. enable_websockets: YES
  64. no_cgi: NO
  65. no_caching: NO
  66. enable_stats: YES
  67. configuration: Release
  68. platform: x64
  69. # Debug builds
  70. - id: Full-x86-Debug
  71. compiler: msvc-19-seh
  72. build_shared: NO
  73. no_files: NO
  74. enable_ipv6: YES
  75. enable_ssl: YES
  76. enable_websockets: YES
  77. no_cgi: NO
  78. no_caching: NO
  79. enable_stats: YES
  80. configuration: Debug
  81. platform: x86
  82. - id: Full-x64-Debug
  83. compiler: msvc-19-seh
  84. build_shared: NO
  85. no_files: NO
  86. enable_ipv6: YES
  87. enable_ssl: YES
  88. enable_websockets: YES
  89. no_cgi: NO
  90. no_caching: NO
  91. enable_stats: YES
  92. configuration: Debug
  93. platform: x64
  94. # Minimum settings
  95. - id: Minimal-x86
  96. compiler: msvc-19-seh
  97. build_shared: NO
  98. no_files: YES
  99. enable_ipv6: NO
  100. enable_ssl: NO
  101. enable_websockets: NO
  102. no_cgi: YES
  103. no_caching: YES
  104. enable_stats: NO
  105. configuration: Release
  106. platform: x86
  107. - id: Minimal-x64
  108. compiler: msvc-19-seh
  109. build_shared: NO
  110. no_files: YES
  111. enable_ipv6: NO
  112. enable_ssl: NO
  113. enable_websockets: NO
  114. no_cgi: YES
  115. no_caching: YeS
  116. enable_stats: NO
  117. configuration: Release
  118. platform: x64
  119. # Test shared and debug build
  120. - id: Shared-default-x86
  121. compiler: msvc-19-seh
  122. build_shared: YES
  123. no_files: NO
  124. enable_ipv6: NO
  125. enable_ssl: YES
  126. enable_websockets: NO
  127. no_cgi: NO
  128. no_caching: NO
  129. enable_stats: NO
  130. configuration: Release
  131. platform: x86
  132. - id: Shared-default-x64
  133. compiler: msvc-19-seh
  134. build_shared: YES
  135. no_files: NO
  136. enable_ipv6: NO
  137. enable_ssl: YES
  138. enable_websockets: NO
  139. no_cgi: NO
  140. no_caching: NO
  141. enable_stats: NO
  142. configuration: Release
  143. platform: x64
  144. # MinGW
  145. - id: Full-GCC-x64
  146. compiler: gcc-5.1.0-posix
  147. build_shared: NO
  148. no_files: NO
  149. enable_ipv6: YES
  150. enable_ssl: YES
  151. enable_websockets: YES
  152. no_cgi: NO
  153. no_caching: NO
  154. enable_stats: YES
  155. configuration: Release
  156. platform: x64
  157. # Visual Studio 2010
  158. - id: Full-VS2010-x86
  159. compiler: msvc-16-seh
  160. build_shared: NO
  161. no_files: NO
  162. enable_ipv6: YES
  163. enable_ssl: YES
  164. enable_websockets: YES
  165. no_cgi: NO
  166. no_caching: NO
  167. enable_stats: YES
  168. configuration: Release
  169. platform: x86
  170. # Visual Studio 2012
  171. - id: Full-VS2012-x86
  172. compiler: msvc-17-seh
  173. build_shared: NO
  174. no_files: NO
  175. enable_ipv6: YES
  176. enable_ssl: YES
  177. enable_websockets: YES
  178. no_cgi: NO
  179. no_caching: NO
  180. enable_stats: YES
  181. configuration: Release
  182. platform: x86
  183. # Visual Studio 2013
  184. - id: Full-VS2013-x86
  185. compiler: msvc-18-seh
  186. build_shared: NO
  187. no_files: NO
  188. enable_ipv6: YES
  189. enable_ssl: YES
  190. enable_websockets: YES
  191. no_cgi: NO
  192. no_caching: NO
  193. enable_stats: YES
  194. configuration: Release
  195. platform: x86
  196. image: Visual Studio 2013
  197. - id: Full-VS2013-x64
  198. compiler: msvc-18-seh
  199. build_shared: NO
  200. no_files: NO
  201. enable_ipv6: YES
  202. enable_ssl: YES
  203. enable_websockets: YES
  204. no_cgi: NO
  205. no_caching: NO
  206. enable_stats: YES
  207. configuration: Release
  208. platform: x64
  209. image: Visual Studio 2013
  210. # Visual Studio 2015
  211. - id: Full-VS2015-x86
  212. compiler: msvc-19-seh
  213. build_shared: NO
  214. no_files: NO
  215. enable_ipv6: YES
  216. enable_ssl: YES
  217. enable_websockets: YES
  218. no_cgi: NO
  219. no_caching: NO
  220. enable_stats: YES
  221. configuration: Release
  222. platform: x86
  223. image: Visual Studio 2015
  224. - id: Full-VS2015-x64
  225. compiler: msvc-19-seh
  226. build_shared: NO
  227. no_files: NO
  228. enable_ipv6: YES
  229. enable_ssl: YES
  230. enable_websockets: YES
  231. no_cgi: NO
  232. no_caching: NO
  233. enable_stats: YES
  234. configuration: Release
  235. platform: x64
  236. image: Visual Studio 2015
  237. # Visual Studio 2017
  238. - id: Full-VS2017-x86
  239. compiler: msvc-20-seh
  240. build_shared: NO
  241. no_files: NO
  242. enable_ipv6: YES
  243. enable_ssl: YES
  244. enable_websockets: YES
  245. no_cgi: NO
  246. no_caching: NO
  247. enable_stats: YES
  248. configuration: Release
  249. platform: x86
  250. APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  251. - id: Full-VS2017-x64
  252. compiler: msvc-20-seh
  253. build_shared: NO
  254. no_files: NO
  255. enable_ipv6: YES
  256. enable_ssl: YES
  257. enable_websockets: YES
  258. no_cgi: NO
  259. no_caching: NO
  260. enable_stats: YES
  261. configuration: Release
  262. platform: x64
  263. APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
  264. # Visual Studio 2019
  265. - id: Full-VS2019-x64
  266. compiler: msvc-21-seh
  267. build_shared: NO
  268. no_files: NO
  269. enable_ipv6: YES
  270. enable_ssl: YES
  271. enable_websockets: YES
  272. no_cgi: NO
  273. no_caching: NO
  274. enable_stats: YES
  275. configuration: Release
  276. platform: x64
  277. APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019
  278. # Ubuntu
  279. - id: Ubuntu1604-GCC-x64
  280. compiler: gcc-5.1.0-posix
  281. build_shared: NO
  282. no_files: NO
  283. enable_ipv6: YES
  284. enable_ssl: YES
  285. enable_websockets: YES
  286. no_cgi: NO
  287. no_caching: NO
  288. enable_stats: YES
  289. configuration: Release
  290. platform: x64
  291. image: Ubuntu1604
  292. - id: Ubuntu1804-GCC-x64
  293. compiler: gcc-5.1.0-posix
  294. build_shared: NO
  295. no_files: NO
  296. enable_ipv6: YES
  297. enable_ssl: YES
  298. enable_websockets: YES
  299. no_cgi: NO
  300. no_caching: NO
  301. enable_stats: YES
  302. configuration: Release
  303. platform: x64
  304. image: Ubuntu1804
  305. - id: Ubuntu2004-GCC-x64
  306. compiler: gcc-5.1.0-posix
  307. build_shared: NO
  308. no_files: NO
  309. enable_ipv6: YES
  310. enable_ssl: YES
  311. enable_websockets: YES
  312. no_cgi: NO
  313. no_caching: NO
  314. enable_stats: YES
  315. configuration: Release
  316. platform: x64
  317. image: Ubuntu2004
  318. install:
  319. # Derive some extra information
  320. - set build_type=%configuration%
  321. - for /f "tokens=1-3 delims=-" %%a in ("%compiler%") do (@set "compiler_name=%%a")
  322. - for /f "tokens=1-3 delims=-" %%a in ("%compiler%") do (@set "compiler_version=%%b")
  323. - for /f "tokens=1-3 delims=-" %%a in ("%compiler%") do (@set "compiler_threading=%%c")
  324. - if "%platform%"=="x64" (set arch=x86_64)
  325. - if "%platform%"=="x86" (set arch=i686)
  326. # Download the specific version of MinGW
  327. - if "%compiler_name%"=="gcc" (@set "mingw_output_folder=C:\mingw-builds")
  328. - if "%compiler_name%"=="gcc" (
  329. @for /f %%a in (
  330. 'call mingw.cmd
  331. /version "%compiler_version%"
  332. /arch "%arch%"
  333. /threading "%compiler_threading%"
  334. "%mingw_output_folder%"'
  335. ) do @set "compiler_path=%%a"
  336. )
  337. - if "%compiler_name%"=="gcc" (@set "mingw_log_folder=%mingw_output_folder%\logs")
  338. - 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"
  339. - if exist "%mingw_log_file%" powershell Push-AppveyorArtifact "%mingw_log_file%" -FileName mingw-download.log
  340. # Get OpenSSL
  341. #
  342. # OpenSSL should already be installed, according to
  343. # - http://help.appveyor.com/discussions/questions/1132-openssl-installation-issues
  344. # - https://github.com/appveyor/ci/issues/576
  345. #
  346. - cmd: set PATH=%PATH%;C:\OpenSSL-Win32;C:\OpenSSL-Win64
  347. - dir C:\OpenSSL-Win32
  348. - dir C:\OpenSSL-Win64
  349. - path
  350. before_build:
  351. # Remove sh.exe from the path otherwise CMake will complain:
  352. # "sh.exe was found in your PATH, here: C:/Program Files/Git/usr/bin/sh.exe"
  353. # and the MinGW build will not work (the Visual Studio build does not care).
  354. # See http://help.appveyor.com/discussions/problems/3193-cmake-building-for-mingw-issue-with-git-shexe
  355. # The entire directory containing sh.exe could be removed from the PATH environment:
  356. # - set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
  357. # However, this will also remove all other programs in this directory from the PATH.
  358. # In particular "patch" is still required.
  359. # So, just rename sh.exe:
  360. - ren "C:\Program Files\Git\usr\bin\sh.exe" _sh.exe
  361. # Set up mingw commands
  362. - if "%compiler_name%"=="gcc" (set "generator=MinGW Makefiles")
  363. - if "%compiler_name%"=="gcc" (set "build=mingw32-make -j4")
  364. - if "%compiler_name%"=="gcc" (set "test=mingw32-make test")
  365. # MSVC specific commands
  366. # Note: The minimum version officially supported for CivetWeb is VS2010. Older ones might work or not.
  367. - if "%compiler_version%"=="14" (set "vs_version=8" & set "vs_year=2005")
  368. - if "%compiler_version%"=="15" (set "vs_version=9" & set "vs_year=2008")
  369. - if "%compiler_version%"=="16" (set "vs_version=10" & set "vs_year=2010")
  370. - if "%compiler_version%"=="17" (set "vs_version=11" & set "vs_year=2012")
  371. - if "%compiler_version%"=="18" (set "vs_version=12" & set "vs_year=2013")
  372. - if "%compiler_version%"=="19" (set "vs_version=14" & set "vs_year=2015")
  373. - if "%compiler_version%"=="20" (set "vs_version=15" & set "vs_year=2017")
  374. - if "%compiler_version%"=="21" (set "vs_version=16" & set "vs_year=2019")
  375. - if "%compiler_name%"=="msvc" (set "generator=Visual Studio %vs_version% %vs_year%")
  376. - set "arch_arg= "
  377. - if "%compiler_name%"=="msvc" (
  378. if "%compiler_version%"=="21" (
  379. set "arch_arg= -A x64 "
  380. )
  381. )
  382. - if "%compiler_name%"=="msvc" (
  383. if not "%compiler_version%"=="21" (
  384. if "%platform%"=="x64" (
  385. set "generator=%generator% Win64"
  386. )
  387. )
  388. )
  389. - if %compiler_version% gtr 9 (set platform=%platform:x86=Win32%)
  390. - if "%compiler_name%"=="msvc" (set "msbuild_opts=/clp:OnlyErrors;OnlyWarnings /nologo /m /v:m")
  391. - if "%compiler_name%"=="msvc" (set "build=msbuild %msbuild_opts% /p:Configuration=%configuration% /p:Platform=%platform% civetweb.sln")
  392. - if "%compiler_name%"=="msvc" (set "test=msbuild %msbuild_opts% RUN_TESTS.vcxproj")
  393. # Add the compiler path if needed
  394. - if not "%compiler_path%"=="" (set "PATH=%PATH%;%compiler_path%")
  395. # git bash conflicts with MinGW makefiles
  396. - if "%generator%"=="MinGW Makefiles" (set "PATH=%PATH:C:\Program Files (x86)\Git\bin=%")
  397. # Useful locations
  398. - set "source_path=%cd%"
  399. - set "output_path=%source_path%\output"
  400. - set "build_path=%output_path%\build"
  401. - set "install_path=%output_path%\install"
  402. - set "third_party_dir=C:\third-party"
  403. # Check some settings of the build server
  404. - ver
  405. - cd
  406. - dir
  407. - ipconfig /all
  408. # Generate the build scripts with CMake
  409. - mkdir "%build_path%"
  410. - cd "%build_path%"
  411. - cmake --version
  412. - echo %generator%
  413. - echo %arch_arg%
  414. - appveyor AddMessage -Category Information "Generating '%generator%'"
  415. - echo cmake
  416. -G "%generator%" %arch_arg%
  417. -DCMAKE_BUILD_TYPE=%build_type%
  418. -DBUILD_SHARED_LIBS=%build_shared%
  419. -DCIVETWEB_SERVE_NO_FILES=%no_files%
  420. "-DCIVETWEB_THIRD_PARTY_DIR=%third_party_dir:\=\\%"
  421. -DCIVETWEB_ENABLE_THIRD_PARTY_OUTPUT=YES
  422. -DCIVETWEB_ENABLE_SSL=%enable_ssl%
  423. -DCIVETWEB_DISABLE_CGI=%no_cgi%
  424. -DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=%enable_ssl_dynamic_loading%
  425. -DCIVETWEB_ENABLE_WEBSOCKETS=%enable_websockets%
  426. -DCIVETWEB_ENABLE_CXX=%enable_cxx%
  427. -DCIVETWEB_ENABLE_LUA=%enable_lua%
  428. -DCIVETWEB_ENABLE_LUA_SHARED=%enable_lua_shared%
  429. -DCIVETWEB_ENABLE_SERVER_STATS=%enable_stats%
  430. -DCIVETWEB_DISABLE_CACHING=%no_caching%
  431. -DCIVETWEB_C_STANDARD=%c_standard%
  432. -DCIVETWEB_CXX_STANDARD=%cxx_standard%
  433. -DCIVETWEB_SSL_OPENSSL_API_1_0=NO
  434. -DCIVETWEB_SSL_OPENSSL_API_1_1=YES
  435. -DCIVETWEB_SSL_OPENSSL_API_3_0=NO
  436. "%source_path%"
  437. - cmake
  438. -G "%generator%" %arch_arg%
  439. -DCMAKE_BUILD_TYPE=%build_type%
  440. -DBUILD_SHARED_LIBS=%build_shared%
  441. -DCIVETWEB_SERVE_NO_FILES=%no_files%
  442. "-DCIVETWEB_THIRD_PARTY_DIR=%third_party_dir:\=\\%"
  443. -DCIVETWEB_ENABLE_THIRD_PARTY_OUTPUT=YES
  444. -DCIVETWEB_ENABLE_SSL=%enable_ssl%
  445. -DCIVETWEB_DISABLE_CGI=%no_cgi%
  446. -DCIVETWEB_ENABLE_SSL_DYNAMIC_LOADING=%enable_ssl_dynamic_loading%
  447. -DCIVETWEB_ENABLE_WEBSOCKETS=%enable_websockets%
  448. -DCIVETWEB_ENABLE_CXX=%enable_cxx%
  449. -DCIVETWEB_ENABLE_LUA=%enable_lua%
  450. -DCIVETWEB_ENABLE_LUA_SHARED=%enable_lua_shared%
  451. -DCIVETWEB_ENABLE_SERVER_STATS=%enable_stats%
  452. -DCIVETWEB_DISABLE_CACHING=%no_caching%
  453. -DCIVETWEB_C_STANDARD=%c_standard%
  454. -DCIVETWEB_CXX_STANDARD=%cxx_standard%
  455. -DCIVETWEB_SSL_OPENSSL_API_1_0=NO
  456. -DCIVETWEB_SSL_OPENSSL_API_1_1=YES
  457. -DCIVETWEB_SSL_OPENSSL_API_3_0=NO
  458. "%source_path%"
  459. - powershell Push-AppveyorArtifact CMakeCache.txt
  460. - cd "%source_path%"
  461. build_script:
  462. - cd
  463. - cd "%build_path%"
  464. - appveyor AddMessage -Category Information "Build command '%build%'"
  465. - cmd /c "%build%"
  466. - cd "%source_path%"
  467. test_script:
  468. - cd "%build_path%"
  469. - appveyor AddMessage -Category Information "Test command '%build%'"
  470. - set CTEST_OUTPUT_ON_FAILURE=1
  471. - cmd /c "%test%" & set "test_ret=%ERRORLEVEL%"
  472. - echo "Test returned %test_ret%"
  473. - dir "%source_path%\output\build\unittest\"
  474. - echo "Show all test logs:"
  475. - for /r %%i in ("%source_path%\output\build\unittest\test-*.log") do (
  476. echo %%i
  477. type %%i
  478. )
  479. - for /r %%i in ("%source_path%\output\build\unittest\test-*.xml") do (
  480. echo %%i
  481. type %%i
  482. )
  483. - cd "%source_path%"
  484. - set "output_path=%source_path%\output"
  485. - set "build_path=%output_path%\build"
  486. - set "install_path=%output_path%\install"
  487. - set "third_party_dir=C:\third-party"
  488. - exit /B %ERRORLEVEL%
  489. - echo "Test script DONE"
  490. after_test:
  491. - echo "Current directory:"
  492. - cd
  493. - dir
  494. - md dist
  495. - if "%build_type%"=="Release" (cmake "-DCMAKE_INSTALL_PREFIX=%install_path%" -P "%build_path%/cmake_install.cmake")
  496. - dir dist\
  497. - echo "Output directory:"
  498. - dir %output_path%
  499. - echo "Build directory:"
  500. - dir %build_path%
  501. - if "%build_type%"=="Release" (echo "Install directory:")
  502. - if "%build_type%"=="Release" (dir %install_path%)
  503. - if "%build_type%"=="Release" (dir %install_path%\bin)
  504. - if "%build_type%"=="Release" (dir %install_path%\include)
  505. - if "%build_type%"=="Release" (dir %install_path%\lib)
  506. - if "%build_type%"=="Release" (copy "%install_path%"\include dist\)
  507. - if "%build_type%"=="Release" (copy "%install_path%"\bin\*.exe dist\)
  508. - echo "Dist directory:"
  509. - dir dist\
  510. cache:
  511. - C:\mingw-builds -> mingw.cmd
  512. - C:\third-party -> **\CMakeLists.txt
  513. - C:\ssl
  514. artifacts:
  515. - path: dist\*
  516. for:
  517. -
  518. matrix:
  519. only:
  520. - configuration: Release
  521. fast_finish: false