forked from open62541/open62541
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
148 lines (138 loc) · 7.8 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
version: '{build}'
clone_folder: c:\projects\open62541
clone_depth: 20
environment:
global:
APPVEYOR_CACHE_ENTRY_ZIP_ARGS: -t7z -m0=lzma -mx=9
CYG_ARCH: x86
CYG_ROOT: C:/cygwin
CYG_SETUP_URL: http://cygwin.com/setup-x86.exe
CYG_MIRROR: http://cygwin.mirror.constant.com
CYG_CACHE: C:\cygwin\var\cache\setup
CYG_BASH: C:/cygwin/bin/bash
matrix:
- CC_NAME: MinGW Makefiles
CC_SHORTNAME: mingw
MAKE: mingw32-make -j
FORCE_CXX: OFF
OUT_DIR_LIB: bin
OUT_DIR_EXAMPLES: bin\examples
- CC_NAME: Visual Studio 9 2008
CC_SHORTNAME: vs2008
# Do not build in parallel, project dependencies are not solved correctly and thus appveyor may randomly fail
MAKE: msbuild /m:1 /p:BuildInParallel=false /p:ContinueOnError=false /p:StopOnFirstFailure=true open62541.sln
FORCE_CXX: ON
OUT_DIR_LIB: bin\Debug
OUT_DIR_EXAMPLES: bin\examples\Debug
- CC_NAME: Visual Studio 12 2013
CC_SHORTNAME: vs2013
# Do not build in parallel, project dependencies are not solved correctly and thus appveyor may randomly fail
MAKE: msbuild /m:1 /p:BuildInParallel=false /p:ContinueOnError=false /p:StopOnFirstFailure=true open62541.sln
FORCE_CXX: OFF
OUT_DIR_LIB: bin\Debug
OUT_DIR_EXAMPLES: bin\examples\Debug
- CC_NAME: Visual Studio 12 2013 Win64
CC_SHORTNAME: vs2013-x64
# Do not build in parallel, project dependencies are not solved correctly and thus appveyor may randomly fail
MAKE: msbuild /m:1 /p:BuildInParallel=false /p:ContinueOnError=false /p:StopOnFirstFailure=true open62541.sln
FORCE_CXX: OFF
OUT_DIR_LIB: bin\Debug
OUT_DIR_EXAMPLES: bin\examples\Debug
cache:
- '%CYG_CACHE%'
- 'c:\miktex'
#- 'c:\python27'
init:
- git config --global core.autocrlf input # Attempt to ensure we don't try to convert line endings to Win32 CRLF as this will cause build to fail
# Install needed build dependencies
install:
- git submodule update --init --recursive
- if not exist "%CYG_ROOT%" mkdir "%CYG_ROOT%"
- ps: echo "Installing Cygwin from $env:CYG_SETUP_URL to $env:CYG_ROOT/setup-x86.exe"
- appveyor DownloadFile %CYG_SETUP_URL% -FileName %CYG_ROOT%/setup-x86.exe
- ps: echo "Downloaded. Now ready to install."
- cmd: '"%CYG_ROOT%/setup-x86.exe" --quiet-mode --no-shortcuts --only-site -R "%CYG_ROOT%" -s "%CYG_MIRROR%" -l "%CYG_CACHE%" --packages cmake,python'
- cmd: '%CYG_BASH% -lc "cygcheck -dc cygwin"'
# Install miktex to get pdflatex, if we don't get it from the cache
- if not exist c:\miktex\texmfs\install\miktex\bin\pdflatex.exe appveyor DownloadFile http://mirrors.ctan.org/systems/win32/miktex/setup/miktex-portable.exe
- if not exist c:\miktex\texmfs\install\miktex\bin\pdflatex.exe 7z x miktex-portable.exe -oc:\miktex >NUL
# Remove some big files to reduce size to be cached
- if exist c:\miktex\texmfs\install\doc rd /s /q c:\miktex\texmfs\install\doc
- if exist c:\miktex\texmfs\install\internal rd /s /q c:\miktex\texmfs\install\internal
- if exist c:\miktex\texmfs\install\miktex\bin\biber.exe rd /s /q c:\miktex\texmfs\install\miktex\bin\biber.exe
- if exist c:\miktex\texmfs\install\miktex\bin\icudt58.dll rd /s /q c:\miktex\texmfs\install\miktex\bin\icudt58.dll
- if exist c:\miktex\texmfs\install\miktex\bin\a5toa4.exe rd /s /q c:\miktex\texmfs\install\miktex\bin\a5toa4.exe
- pip install --user sphinx sphinx_rtd_theme
before_build:
# use MinGW64
- set PATH=C:\mingw-w64\i686-5.3.0-posix-dwarf-rt_v4-rev0\mingw32\bin;%PATH%
# Workaround for CMake not wanting sh.exe on PATH for MinGW
- set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
# Miktex
- set "PATH=%PATH%;c:\miktex\texmfs\install\miktex\bin;%APPDATA%\Python\Scripts"
# autoinstall latex packages (0=no, 1=autoinstall, 2=ask)
# this adds this to the registry!
- initexmf --set-config-value [MPM]AutoInstall=1
- initexmf --update-fndb
build_script:
# log is loaded from cache, so we strip it here
- rd /s /q c:\miktex\texmfs\data\miktex\log
- cd c:\projects\open62541
# Collect files for .zip packing
- md pack
- copy "%APPVEYOR_BUILD_FOLDER%\LICENSE" pack\
- copy "%APPVEYOR_BUILD_FOLDER%\AUTHORS" pack\
- copy "%APPVEYOR_BUILD_FOLDER%\README.md" pack\
# now start build
- md build
- cd build
- echo. && echo "##### Building Documentation on %CC_NAME% #####" && echo.
- cmake -DMIKTEX_BINARY_PATH=c:\miktex\texmfs\install\miktex\bin -DCMAKE_BUILD_TYPE=Release -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -DUA_BUILD_EXAMPLES:BOOL=OFF -G"%CC_NAME%" ..
- cmake --build . --target doc_latex & cmake --build . --target doc_pdf
- move "%APPVEYOR_BUILD_FOLDER%\build\doc_latex\open62541.pdf" %APPVEYOR_BUILD_FOLDER%\pack\
- cd ..
- rd /s /q build
- md build
- cd build
- echo. && echo "##### Testing %CC_NAME% #####" && echo.
- cmake -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -G"%CC_NAME%" ..
- '%MAKE%'
- cd ..
- rd /s /q build
- md build
- cd build
- echo. && echo "##### Testing %CC_NAME% with amalgamation #####" && echo.
- cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -DBUILD_SHARED_LIBS:BOOL=OFF -G"%CC_NAME%" ..
- '%MAKE%'
- md %APPVEYOR_BUILD_FOLDER%\pack_tmp
- move "%APPVEYOR_BUILD_FOLDER%\build\open62541.c" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
- move "%APPVEYOR_BUILD_FOLDER%\build\open62541.h" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
- move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_EXAMPLES%\server.exe" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
- move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_EXAMPLES%\client.exe" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
- if "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\libopen62541.a" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
- if not "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\open62541.lib" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
- cd ..
- 7z a -tzip open62541-%CC_SHORTNAME%-static.zip "%APPVEYOR_BUILD_FOLDER%\pack\*" "%APPVEYOR_BUILD_FOLDER%\pack_tmp\*"
- rd /s /q pack_tmp
- rd /s /q build
- md build
- cd build
- echo. && echo "##### Testing %CC_NAME% with amalgamation and .dll #####" && echo.
- cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DUA_BUILD_EXAMPLES:BOOL=ON -DUA_ENABLE_AMALGAMATION:BOOL=ON -DUA_COMPILE_AS_CXX:BOOL=%FORCE_CXX% -DBUILD_SHARED_LIBS:BOOL=ON -G"%CC_NAME%" ..
- '%MAKE%'
- md %APPVEYOR_BUILD_FOLDER%\pack_tmp
- move "%APPVEYOR_BUILD_FOLDER%\build\open62541.c" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
- move "%APPVEYOR_BUILD_FOLDER%\build\open62541.h" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
- move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_EXAMPLES%\server.exe" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
- move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_EXAMPLES%\client.exe" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
- if "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\libopen62541.dll" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
- if "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\libopen62541.dll.a" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
- if not "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\open62541.dll" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
- if not "%CC_SHORTNAME%" == "mingw" move "%APPVEYOR_BUILD_FOLDER%\build\%OUT_DIR_LIB%\open62541.pdb" %APPVEYOR_BUILD_FOLDER%\pack_tmp\
- cd ..
- 7z a -tzip open62541-%CC_SHORTNAME%-dynamic.zip "%APPVEYOR_BUILD_FOLDER%\pack\*" "%APPVEYOR_BUILD_FOLDER%\pack_tmp\*"
# do not cache log
- rd /s /q c:\miktex\texmfs\data\miktex\log
after_build:
- appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\open62541-%CC_SHORTNAME%-static.zip
- appveyor PushArtifact %APPVEYOR_BUILD_FOLDER%\open62541-%CC_SHORTNAME%-dynamic.zip