forked from mavlink/MAVSDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
159 lines (144 loc) · 5.08 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
# Specify version format
version: "{build}"
# Operating system (build VM template)
os: Visual Studio 2017
# build platform, i.e. Win32 (instead of x86), x64, Any CPU. This setting is optional.
platform:
- x64
# specify custom environment variables
environment:
MSVC_DEFAULT_OPTIONS: ON
# only build PR but not branch as well
skip_branch_with_pr: true
# build configuration, i.e. Debug, Release, etc.
configuration:
- Debug
- Release
# scripts that are called at very beginning, before repo cloning
init:
- cmake --version
- msbuild /version
# clone directory
clone_folder: C:\dronecore
# scripts to run before build
before_build:
- cd C:\dronecore
- git submodule update --init --recursive --depth 20
- cd C:\
- appveyor DownloadFile https://curl.haxx.se/download/curl-7.56.1.zip
- 7z x -y curl-7.56.1.zip
- appveyor DownloadFile https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.7z
- 7z x -y boost_1_64_0.7z
build: on
build_script:
- set CL=/MP
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat"
- cd curl-7.56.1\winbuild
- if "%configuration%"=="Debug" (
nmake /f Makefile.vc mode=static VC=15 MACHINE=x64 DEBUG=yes
) else (
nmake /f Makefile.vc mode=static VC=15 MACHINE=x64 DEBUG=no
)
- set dronecore_dir=C:\dronecore
- cd %dronecore_dir%
- md build
- cd build
- if "%configuration%"=="Debug" (
cmake -DWIN_CURL_INCLUDE_DIR:STRING="C:\curl-7.56.1\include" -DWIN_CURL_LIB:STRING="C:\curl-7.56.1\builds\libcurl-vc15-x64-debug-static-ipv6-sspi-winssl\lib\libcurl_a_debug.lib" -G "Visual Studio 15 2017 Win64" ..
) else (
cmake -DWIN_CURL_INCLUDE_DIR:STRING="C:\curl-7.56.1\include" -DWIN_CURL_LIB:STRING="C:\curl-7.56.1\builds\libcurl-vc15-x64-release-static-ipv6-sspi-winssl\lib\libcurl_a.lib" -G "Visual Studio 15 2017 Win64" ..
)
- if "%configuration%"=="Debug" (
cmake --build . --target install --config Debug
) else (
cmake --build . --target install --config Release
)
- cd C:\boost_1_64_0
- set boost_dir=C:\boost_1_64_0
- set cores=%NUMBER_OF_PROCESSORS%
- set msvcver=msvc-14.1
- cd %boost_dir%
- bootstrap.bat
- b2 --with-system --with-date_time --j%cores% toolset=%msvcver% address-model=64 architecture=x86 link=static threading=multi runtime-link=shared --build-type=minimal stage --stagedir=stage/x64
- set BOOST_ROOT=%boost_dir%
- set BOOST_LIBRARYDIR=%boost_dir%\stage\x64\lib
- cd %dronecore_dir%
- cd example\takeoff_land
- md build
- cd build
- cmake .. -G "Visual Studio 15 2017 Win64"
- if "%configuration%"=="Debug" (
cmake --build . --config Debug
) else (
cmake --build . --config Release
)
- cd %dronecore_dir%
- cd example\fly_mission
- md build
- cd build
- cmake .. -G "Visual Studio 15 2017 Win64"
- if "%configuration%"=="Debug" (
cmake --build . --config Debug
) else (
cmake --build . --config Release
)
- cd %dronecore_dir%
- cd example\offboard_velocity
- md build
- cd build
- cmake .. -G "Visual Studio 15 2017 Win64"
- if "%configuration%"=="Debug" (
cmake --build . --config Debug
) else (
cmake --build . --config Release
)
- cd %dronecore_dir%
- cd example\transition_vtol_fixed_wing
- md build
- cd build
- cmake .. -G "Visual Studio 15 2017 Win64"
- if "%configuration%"=="Debug" (
cmake --build . --config Debug
) else (
cmake --build . --config Release
)
- cd %dronecore_dir%
- cd example\follow_me
- md build
- cd build
- cmake .. -G "Visual Studio 15 2017 Win64" -DBoost_USE_STATIC_LIBS=ON
- if "%configuration%"=="Debug" (
cmake --build . --config Debug
) else (
cmake --build . --config Release
)
- cd %dronecore_dir%
- cd example\fly_qgc_mission
- md build
- cd build
- cmake .. -G "Visual Studio 15 2017 Win64"
- if "%configuration%"=="Debug" (
cmake --build . --config Debug
) else (
cmake --build . --config Release
)
- cd %dronecore_dir%
test: on
# We need to manually copy the dlls for now, otherwise they are not found.
test_script:
- cd %dronecore_dir%
- if "%configuration%"=="Debug" (
copy build\third_party\gtest\googlemock\gtest\Debug\gtestd.dll build\Debug\ &&
copy build\third_party\gtest\googlemock\gtest\Debug\gtest_maind.dll build\Debug\ &&
copy build\third_party\gtest\googlemock\Debug\gmockd.dll build\Debug\ &&
copy build\plugins\mission\Debug\dronecore_mission.dll build\Debug\ &&
copy build\plugins\mission\third_party\json11\Debug\json11.dll build\Debug\ &&
build\Debug\unit_tests_runner.exe
) else (
copy build\third_party\gtest\googlemock\gtest\Release\gtest.dll build\Release\ &&
copy build\third_party\gtest\googlemock\gtest\Release\gtest_main.dll build\Release\ &&
copy build\third_party\gtest\googlemock\Release\gmock.dll build\Release\ &&
copy build\plugins\mission\Release\dronecore_mission.dll build\Release\ &&
copy build\plugins\mission\third_party\json11\Release\json11.dll build\Release\ &&
build\Release\unit_tests_runner.exe
)