MinGW Appveyor builds

- Build for MinGW x86/x86_64. Move build scripts out of the yml file into
  separate batch files.
- The MinGW builds use MSYS to get runtime dependencies, but they do not
  link against the POSIX adaptation layer.
- For now only build the nvim.exe binary, but not the helptags.
This commit is contained in:
Rui Abreu Ferreira 2016-07-29 10:12:10 +01:00 committed by Rui Abreu Ferreira
parent 55682710a9
commit f53c8258be
3 changed files with 72 additions and 17 deletions

24
.ci/msys_build.bat Normal file
View File

@ -0,0 +1,24 @@
echo on
if "%TARGET%" == "MINGW_32" (
set ARCH=i686
set BITS=32
) else (
set ARCH=x86_64
set BITS=64
)
:: We cannot have sh.exe in the PATH (MinGW)
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
set PATH=C:\msys64\mingw%BITS%\bin;C:\Windows\System32;C:\Windows;%PATH%
mkdir build
cd build
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release .. || goto :error
:: FIXME(equalsraf): for now just build nvim and copy DLLs.
:: We can't generate the helptags just yet (#810 fixes this)
mingw32-make nvim_dll_deps VERBOSE=1 || goto :error
bin\nvim --version || goto :error
cd ..
goto :EOF
:error
exit /b %errorlevel%

27
.ci/msys_build_deps.bat Normal file
View File

@ -0,0 +1,27 @@
:: These are native MinGW builds, but they use the toolchain inside
:: MSYS2, this allows using all the dependencies and tools available
:: in MSYS2, but we cannot build inside the MSYS2 shell.
echo on
if "%TARGET%" == "MINGW_32" (
set ARCH=i686
set BITS=32
) else (
set ARCH=x86_64
set BITS=64
)
:: We cannot have sh.exe in the PATH (MinGW)
set PATH=%PATH:C:\Program Files\Git\usr\bin;=%
set PATH=C:\msys64\mingw%BITS%\bin;C:\Windows\System32;C:\Windows;%PATH%
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm -Su" || goto :error
C:\msys64\usr\bin\bash -lc "pacman --verbose --noconfirm --needed -S mingw-w64-%ARCH%-cmake mingw-w64-%ARCH%-perl mingw-w64-%ARCH%-python2 mingw-w64-%ARCH%-diffutils" || goto :error
mkdir .deps
cd .deps
cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release ..\third-party\ || goto :error
mingw32-make VERBOSE=1 || goto :error
cd ..
goto :EOF
:error
exit /b %errorlevel%

View File

@ -1,23 +1,27 @@
version: '{build}'
skip_tags: true
os: Windows Server 2012 R2
environment:
GYP_MSVS_VERSION: 2015
# The default cpack in the PATH is not CMake
CPACK: C:\Program Files (x86)\CMake\bin\cpack.exe
matrix:
- GENERATOR: Visual Studio 14 Win64
DEPS_PATH: deps64
- GENERATOR: Visual Studio 14
DEPS_PATH: deps32
matrix:
# Allow builds to fail
allow_failures:
- os: Windows Server 2012 R2
- TARGET: MINGW_64
BUILD_DEPS_SCRIPT: .ci\msys_build_deps.bat
BUILD_SCRIPT: .ci\msys_build.bat
- TARGET: MINGW_32
BUILD_DEPS_SCRIPT: .ci\msys_build_deps.bat
BUILD_SCRIPT: .ci\msys_build.bat
install: []
build_script:
# See http://help.appveyor.com/discussions/problems/539-cloning-gyp-fails
- git config --global url."http://".insteadOf https://
- mkdir %DEPS_PATH%
- cd %DEPS_PATH%
- cmake -G "%GENERATOR%" ..\third-party\
- cmake --build .
- cd ..
- if defined BUILD_DEPS_SCRIPT call %BUILD_DEPS_SCRIPT%
- call %BUILD_SCRIPT%
# FIXME(equalsraf): don't generate artifacts until the
# build script builds the main target, for now pack bin/
artifacts:
- path: build/bin
# Build artifacts
#- cd build
#- '"%CPACK%" -G NSIS -C Release'
#- '"%CPACK%" -G ZIP -C Release'
#artifacts:
#- path: build/Neovim.zip
#- path: build/Neovim.exe