Skip to content

Commit

Permalink
Add Cygwin, MinGW and MSYS2 64-bit compiler
Browse files Browse the repository at this point in the history
Move some part to a separate batch file.
  • Loading branch information
k-takata committed Oct 4, 2015
1 parent e83dd38 commit b14ca47
Show file tree
Hide file tree
Showing 2 changed files with 140 additions and 10 deletions.
26 changes: 16 additions & 10 deletions appveyor.yml
Expand Up @@ -2,23 +2,29 @@
version: '{build}'
shallow_clone: true
environment:
global:
MSYS2_BASEVER: 20150916
matrix:
- CPU: i386
- COMPILER: msvc
CPU: i386
ENV: /x86
BIT: 32
- CPU: AMD64
- COMPILER: msvc
CPU: AMD64
ENV: /x64
BIT: 64
install:
- '"C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" %ENV%'
- appveyor DownloadFile http://files.kaoriya.net/vim/vim74-kaoriya-win%BIT%.zip -FileName vim.zip
- 7z x vim.zip > nul
- git clone -q https://github.com/thinca/vim-themis.git themis --depth=1
- set THEMIS_VIM=%APPVEYOR_BUILD_FOLDER%\vim74-kaoriya-win%BIT%\vim.exe
- COMPILER: cygwin
- COMPILER: mingw
BIT: 32
- COMPILER: msys2
MSYS2_ARCH: x86_64
MSYS2_DIR: msys64
MSYSTEM: MINGW64
BIT: 64
build_script:
- nmake -f make_msvc.mak nodebug=1 CPU=%CPU%
- '%APPVEYOR_BUILD_FOLDER%\tools\appveyor.bat'
test_script:
- themis\bin\themis
- '%APPVEYOR_BUILD_FOLDER%\tools\appveyor.bat test'
artifacts:
- path: autoload/vimproc_*.dll
name: vimproc.dll
Expand Down
124 changes: 124 additions & 0 deletions tools/appveyor.bat
@@ -0,0 +1,124 @@
@echo off
:: Batch file for building/testing vimproc on AppVeyor

cd %APPVEYOR_BUILD_FOLDER%
if /I "%1"=="test" (
set _target=_test
) else (
set _target=
)

for %%i in (msvc mingw msys2 cygwin) do if "%compiler%"=="%%i" goto %compiler%%_target%

echo Unknown build target.
exit 1

:msvc
:: ----------------------------------------------------------------------
:: Using VC10 with nmake
::call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" %ARCH%
call :install_vim
call "C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\SetEnv.cmd" %ENV%

@echo on
nmake -f make_msvc.mak nodebug=1 CPU=%CPU%

@echo off
goto :eof

:msvc_test
set THEMIS_VIM=%APPVEYOR_BUILD_FOLDER%\vim74-kaoriya-win%BIT%\vim.exe
@echo on
themis\bin\themis

@echo off
goto :eof


:mingw
:: ----------------------------------------------------------------------
:: Using MinGW
call :install_vim
@echo on
path C:\MinGW\bin;C:\MinGW\msys\1.0\bin;%path%
make -f make_mingw32.mak

@echo off
goto :eof

:mingw_test
set THEMIS_VIM=%APPVEYOR_BUILD_FOLDER%\vim74-kaoriya-win%BIT%\vim.exe
@echo on
themis\bin\themis

@echo off
goto :eof


:msys2
:: ----------------------------------------------------------------------
:: Using MSYS2
call :install_vim
@echo on
:: Install MSYS2
appveyor DownloadFile "http://repo.msys2.org/distrib/%MSYS2_ARCH%/msys2-base-%MSYS2_ARCH%-%MSYS2_BASEVER%.tar.xz" -FileName "msys2.tar.xz"
c:\cygwin\bin\xz -dc msys2.tar.xz | c:\cygwin\bin\tar xf -

PATH %APPVEYOR_BUILD_FOLDER%\%MSYS2_DIR%\%MSYSTEM%\bin;%APPVEYOR_BUILD_FOLDER%\%MSYS2_DIR%\usr\bin;%PATH%
set CHERE_INVOKING=yes
bash -lc ""
:: Install and update necessary packages
bash -lc "for i in {1..3}; do update-core && break || sleep 15; done"
bash -lc "for i in {1..3}; do pacman --noconfirm -Su mingw-w64-%MSYS2_ARCH%-{gcc,libiconv} automake autoconf make dos2unix && break || sleep 15; done"

bash -lc "make -f make_mingw%BIT%.mak"

@echo off
goto :eof

:msys2_test
set THEMIS_VIM=%APPVEYOR_BUILD_FOLDER%\vim74-kaoriya-win%BIT%\vim.exe
@echo on
themis\bin\themis

@echo off
goto :eof


:cygwin
:: ----------------------------------------------------------------------
:: Using Cygwin
@echo on
c:\cygwin\setup-x86.exe -qnNdO -R C:/cygwin -s http://cygwin.mirror.constant.com -l C:/cygwin/var/cache/setup -P vim
PATH c:\cygwin\bin;%PATH%
set CHERE_INVOKING=yes
bash -lc ""
bash -lc "make"

@echo off
goto :eof

:cygwin_test
@echo on
bash -lc "git clone -q https://github.com/thinca/vim-themis.git themis --depth=1"
bash -lc "themis/bin/themis test/fopen.vim"
bash -lc "themis/bin/themis test/functions.vim"
bash -lc "themis/bin/themis test/lexer.vim"
bash -lc "themis/bin/themis test/parser.vim"
bash -lc "themis/bin/themis test/popen.vim"
bash -lc "themis/bin/themis test/socket.vim"
bash -lc "themis/bin/themis test/system.vim"

@echo off
goto :eof


:install_vim
:: ----------------------------------------------------------------------
:: Install Vim and themis
echo Downloading Vim
appveyor DownloadFile http://files.kaoriya.net/vim/vim74-kaoriya-win%BIT%.zip -FileName vim.zip
echo Installing Vim
7z x vim.zip > nul
git clone -q https://github.com/thinca/vim-themis.git themis --depth=1
exit /b

0 comments on commit b14ca47

Please sign in to comment.