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 MSYS |
| 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 | ECHO Unsupported PROFILE=%PROFILE% or PLATFORM=%PLATFORM% |
| 35 | EXIT /B 1 |
| 36 | |
| 37 | |
| 38 | SET BASH=C:\msys64\usr\bin\bash |
| 39 | SET CMAKE=/c/msys64/mingw64/bin/cmake.exe |
| 40 | |
| 41 | |
| 42 | CALL win_showenv.bat || EXIT /B |
| 43 | |
| 44 | SET PACKAGES=^ |
| 45 | base-devel ^ |
| 46 | mingw-w64-x86_64-toolchain ^ |
| 47 | bison ^ |
| 48 | flex ^ |
| 49 | make ^ |
| 50 | mingw-w64-x86_64-cmake ^ |
| 51 | mingw-w64-x86_64-libevent ^ |
| 52 | mingw-w64-x86_64-openssl ^ |
| 53 | mingw-w64-x86_64-zlib |
| 54 | |
| 55 | :: Upgrade things |
| 56 | %BASH% -lc "pacman --noconfirm -Syu %IGNORE%" || EXIT /B |
| 57 | %BASH% -lc "pacman --noconfirm -Su %IGNORE%" || EXIT /B |
| 58 | %BASH% -lc "pacman --noconfirm --needed -S %PACKAGES%" || EXIT /B |
| 59 | |
| 60 | |
| 61 | :: |
| 62 | :: Configure and build our software with cmake |
| 63 | :: |
| 64 | |
| 65 | SET CMAKEARGS=^ |
| 66 | -G'%GENERATOR%' ^ |
| 67 | -DBoost_DEBUG=ON ^ |
| 68 | -DBoost_NAMESPACE=libboost ^ |
| 69 | -DBOOST_INCLUDEDIR=%BOOST_INCLUDEDIR% ^ |
| 70 | -DBOOST_LIBRARYDIR=%BOOST_LIBRARYDIR% ^ |
| 71 | -DCMAKE_BUILD_TYPE=%CONFIGURATION% ^ |
| 72 | -DCMAKE_C_COMPILER=gcc.exe ^ |
| 73 | -DCMAKE_CXX_COMPILER=g++.exe ^ |
| 74 | -DCMAKE_MAKE_PROGRAM=make.exe ^ |
| 75 | -DCMAKE_INSTALL_PREFIX=%INSTDIR_MSYS% ^ |
| 76 | -DLIBEVENT_ROOT=%LIBEVENT_ROOT% ^ |
| 77 | -DOPENSSL_LIBRARIES=%OPENSSL_LIBRARIES% ^ |
| 78 | -DOPENSSL_ROOT_DIR=%OPENSSL_ROOT% ^ |
| 79 | -DOPENSSL_USE_STATIC_LIBS=ON ^ |
| 80 | -DWITH_BOOST_STATIC=ON ^ |
| 81 | -DWITH_JAVA=OFF ^ |
| 82 | -DWITH_LIBEVENT=ON ^ |
| 83 | -DWITH_PYTHON=%WITH_PYTHON% ^ |
| 84 | -DWITH_SHARED_LIB=OFF ^ |
| 85 | -DWITH_STATIC_LIB=ON |
| 86 | |
| 87 | %BASH% -lc "mkdir %BUILDDIR% && cd %BUILDDIR% && %CMAKE% %SRCDIR_MSYS% %CMAKEARGS% && %CMAKE% --build . --config %CONFIGURATION% && %CMAKE% --install . --config %CONFIGURATION%" || EXIT /B |
| 88 | |
| 89 | |
| 90 | :: |
| 91 | :: Execute our tests |
| 92 | :: |
| 93 | |
| 94 | :: This test randomly fails on mingw; see Jira THRIFT-4106 |
| 95 | SET DISABLED_TESTS=(concurrency_test) |
| 96 | SET DISABLED_TESTS_COMMAND=--exclude-regex '%DISABLED_TESTS%' |
| 97 | |
| 98 | %BASH% -lc "cd %BUILDDIR% && ctest.exe --build-config %CONFIGURATION% --timeout 300 --extra-verbose %DISABLED_TESTS_COMMAND%" || EXIT /B |