blob: 7f874d9387e9cf50e47cc57f4bf2a9a0625e44ad [file] [log] [blame]
Mario Emmenlauerffc7bb92021-08-05 17:23:35 +02001::
2:: Licensed under the Apache License, Version 2.0 (the "License");
3:: you may not use this file except in compliance with the License.
4:: You may obtain a copy of the License at
5::
6:: http://www.apache.org/licenses/LICENSE-2.0
7::
8:: Unless required by applicable law or agreed to in writing, software
9:: distributed under the License is distributed on an "AS IS" BASIS,
10:: WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11:: See the License for the specific language governing permissions and
12:: limitations under the License.
13::
14
15::
16:: Appveyor script for CYGWIN
17::
18
19::
20:: Installs third party packages we need for a cmake build
21::
22
23@ECHO ON
24SETLOCAL EnableDelayedExpansion
25
26CD build\appveyor || EXIT /B
27
28SET APPVEYOR_SCRIPTS=%APPVEYOR_BUILD_FOLDER%\build\appveyor
29SET BUILDDIR=%APPVEYOR_BUILD_FOLDER%\..\build\%PROFILE%\%PLATFORM%
30SET INSTDIR=%APPVEYOR_BUILD_FOLDER%\..\install\%PROFILE%\%PLATFORM%
31SET SRCDIR=%APPVEYOR_BUILD_FOLDER%
32
33
34:: compiler and generator detection
35SET COMPILER=gcc
36SET GENERATOR=Unix Makefiles
37
38IF "%PLATFORM%" == "x64" (
39 SET CYGWINROOT=C:\cygwin64
40) ELSE (
41 SET CYGWINROOT=C:\cygwin
42)
43
44IF "%PLATFORM%" == "x64" (
45 SET SETUP=!CYGWINROOT!\setup-x86_64.exe
46) ELSE (
47 SET SETUP=!CYGWINROOT!\setup-x86.exe
48)
49
50SET BASH=!CYGWINROOT!\bin\bash.exe
51SET BUILDDIR=%BUILDDIR:\=/%
52SET BUILDDIR=/cygdrive/c!BUILDDIR:~2!
53SET INSTDIR=%INSTDIR:\=/%
54SET INSTDIR=/cygdrive/c!INSTDIR:~2!
55SET SRCDIR=%SRCDIR:\=/%
56SET SRCDIR=/cygdrive/c!SRCDIR:~2!
57
58
59CALL win_showenv.bat || EXIT /B
60
61::
62:: Install apt-cyg for package management because its easier to use
63:: than Cygwins setup.exe. But both are possible to use.
64::
65
66%BASH% -lc "wget https://rawgit.com/transcode-open/apt-cyg/master/apt-cyg && install apt-cyg /bin && rm -f apt-cyg" || EXIT /B
67%BASH% -lc "apt-cyg update" || EXIT /B
68%BASH% -lc "apt-cyg install unzip xz cmake make bison flex gcc-g++ libboost-devel libevent-devel openssl-devel zlib-devel" || EXIT /B
69
70
71::
72:: Configure and build our software with cmake
73::
74
75SET CMAKEARGS=^
76 -G'%GENERATOR%' ^
77 -DCMAKE_BUILD_TYPE=%CONFIGURATION% ^
78 -DCMAKE_INSTALL_PREFIX=%INSTDIR% ^
79 -DCMAKE_CXX_FLAGS="-D_GNU_SOURCE" ^
80 -DWITH_JAVA=OFF ^
81 -DWITH_PYTHON=OFF
82
83:: -DCMAKE_CXX_EXTENSIONS=ON ^
84:: -DCMAKE_CXX_STANDARD=11 ^
85
86
87%BASH% -lc "mkdir -p %BUILDDIR% && cd %BUILDDIR% && cmake.exe %SRCDIR% %CMAKEARGS% && cmake --build . --config %CONFIGURATION% && cmake --install . --config %CONFIGURATION%" || EXIT /B
88
89
90::
91:: Execute our tests
92::
93
94SET DISABLED_TESTS_COMMAND=--exclude-regex '%DISABLED_TESTS%'
95
96%BASH% -lc "cd %BUILDDIR% && ctest.exe --build-config %CONFIGURATION% --timeout 300 --extra-verbose %DISABLED_TESTS_COMMAND%" || EXIT /B