Mario Emmenlauer | ffc7bb9 | 2021-08-05 17:23:35 +0200 | [diff] [blame] | 1 | :: |
| 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 |
| 24 | SETLOCAL EnableDelayedExpansion |
| 25 | |
| 26 | CD build\appveyor || EXIT /B |
| 27 | |
| 28 | SET APPVEYOR_SCRIPTS=%APPVEYOR_BUILD_FOLDER%\build\appveyor |
| 29 | SET BUILDDIR=%APPVEYOR_BUILD_FOLDER%\..\build\%PROFILE%\%PLATFORM% |
| 30 | SET INSTDIR=%APPVEYOR_BUILD_FOLDER%\..\install\%PROFILE%\%PLATFORM% |
| 31 | SET SRCDIR=%APPVEYOR_BUILD_FOLDER% |
| 32 | |
| 33 | |
| 34 | :: compiler and generator detection |
| 35 | SET COMPILER=gcc |
| 36 | SET GENERATOR=Unix Makefiles |
| 37 | |
| 38 | IF "%PLATFORM%" == "x64" ( |
| 39 | SET CYGWINROOT=C:\cygwin64 |
| 40 | ) ELSE ( |
| 41 | SET CYGWINROOT=C:\cygwin |
| 42 | ) |
| 43 | |
| 44 | IF "%PLATFORM%" == "x64" ( |
| 45 | SET SETUP=!CYGWINROOT!\setup-x86_64.exe |
| 46 | ) ELSE ( |
| 47 | SET SETUP=!CYGWINROOT!\setup-x86.exe |
| 48 | ) |
| 49 | |
| 50 | SET BASH=!CYGWINROOT!\bin\bash.exe |
| 51 | SET BUILDDIR=%BUILDDIR:\=/% |
| 52 | SET BUILDDIR=/cygdrive/c!BUILDDIR:~2! |
| 53 | SET INSTDIR=%INSTDIR:\=/% |
| 54 | SET INSTDIR=/cygdrive/c!INSTDIR:~2! |
| 55 | SET SRCDIR=%SRCDIR:\=/% |
| 56 | SET SRCDIR=/cygdrive/c!SRCDIR:~2! |
| 57 | |
| 58 | |
| 59 | CALL 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 | |
| 75 | SET 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 | |
| 94 | SET 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 |