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