aboutsummaryrefslogtreecommitdiff
path: root/ci
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-03-08 20:26:18 +0100
committerGitHub <noreply@github.com>2018-03-08 20:26:18 +0100
commit9cefd83cc7b96d9a20ae8aae5ad5f2c4a02a74f4 (patch)
tree2933dd4aa96bd42eb8939c7a2afe2fcf544834f1 /ci
parentd82621877b72ee8322a5b88adaba4edd5ad3b308 (diff)
parent0adf950ccf9a0057c552a349d79a716ff7be6f8f (diff)
downloadrneovim-9cefd83cc7b96d9a20ae8aae5ad5f2c4a02a74f4.tar.gz
rneovim-9cefd83cc7b96d9a20ae8aae5ad5f2c4a02a74f4.tar.bz2
rneovim-9cefd83cc7b96d9a20ae8aae5ad5f2c4a02a74f4.zip
Merge #8084 'build/win: support MSVC'
Diffstat (limited to 'ci')
-rw-r--r--ci/build.bat53
1 files changed, 31 insertions, 22 deletions
diff --git a/ci/build.bat b/ci/build.bat
index 5c7f14ad0a..3fa185f646 100644
--- a/ci/build.bat
+++ b/ci/build.bat
@@ -1,27 +1,34 @@
-:: 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 "%CONFIGURATION%" == "MINGW_32" (
set ARCH=i686
set BITS=32
-) else (
+) else if "%CONFIGURATION:~0,8%" == "MINGW_64" (
set ARCH=x86_64
set BITS=64
+ if "%CONFIGURATION%" == "MINGW_64-gcov" (
+ set USE_GCOV="-DUSE_GCOV=ON"
+ )
+) else if "%CONFIGURATION%" == "MSVC_32" (
+ set CMAKE_GENERATOR="Visual Studio 15 2017"
+) else if "%CONFIGURATION%" == "MSVC_64" (
+ set CMAKE_GENERATOR="Visual Studio 15 2017 Win64"
)
-if "%CONFIGURATION%" == "MINGW_64-gcov" (
- set USE_GCOV="-DUSE_GCOV=ON"
-)
-
-:: 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%
-:: The default cpack in the PATH is not CMake
-set PATH=C:\Program Files (x86)\CMake\bin\cpack.exe;%PATH%
-:: Build third-party dependencies
-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%-diffutils mingw-w64-%ARCH%-unibilium gperf" || goto :error
+if "%CONFIGURATION:~0,5%" == "MINGW" (
+ :: 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.
+ set CMAKE_GENERATOR="MinGW Makefiles"
+ set CMAKE_GENERATOR_ARGS=VERBOSE=1
+ :: Add MinGW to the PATH and remove the Git directory because it
+ :: has a conflicting sh.exe
+ set "PATH=C:\msys64\mingw%BITS%\bin;C:\Windows\System32;C:\Windows;%PATH:C:\Program Files\Git\usr\bin;=%"
+ :: Build third-party dependencies
+ 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%-diffutils mingw-w64-%ARCH%-unibilium gperf" || goto :error
+) else if "%CONFIGURATION:~0,4%" == "MSVC" (
+ set CMAKE_GENERATOR_ARGS=/verbosity:normal
+)
:: Setup python (use AppVeyor system python)
C:\Python27\python.exe -m pip install neovim || goto :error
@@ -42,19 +49,19 @@ where.exe neovim-node-host.cmd || goto :error
mkdir .deps
cd .deps
-cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo ..\third-party\ || goto :error
-mingw32-make VERBOSE=1 || goto :error
+cmake -G %CMAKE_GENERATOR% -DCMAKE_BUILD_TYPE=RelWithDebInfo ..\third-party\ || goto :error
+cmake --build . -- %CMAKE_GENERATOR_ARGS% || goto :error
cd ..
:: Build Neovim
mkdir build
cd build
-cmake -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUSTED_OUTPUT_TYPE=nvim %USE_GCOV% -DGPERF_PRG="C:\msys64\usr\bin\gperf.exe" .. || goto :error
-mingw32-make VERBOSE=1 || goto :error
+cmake -G %CMAKE_GENERATOR% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DBUSTED_OUTPUT_TYPE=nvim %USE_GCOV% -DGPERF_PRG="C:\msys64\usr\bin\gperf.exe" .. || goto :error
+cmake --build . --config RelWithDebInfo -- %CMAKE_GENERATOR_ARGS% || goto :error
bin\nvim --version || goto :error
:: Functional tests
-mingw32-make functionaltest VERBOSE=1 || goto :error
+cmake --build . --config RelWithDebInfo --target functionaltest -- %CMAKE_GENERATOR_ARGS% || goto :error
if defined USE_GCOV (
C:\msys64\usr\bin\bash -lc "cd /c/projects/neovim; bash <(curl -s https://codecov.io/bash) -c -F functionaltest || echo 'codecov upload failed.'"
@@ -63,13 +70,15 @@ if defined USE_GCOV (
:: Old tests
setlocal
set PATH=%PATH%;C:\msys64\usr\bin
-mingw32-make -C "%~dp0\..\src\nvim\testdir" VERBOSE=1
+cmake --build "%~dp0\..\src\nvim\testdir" -- %CMAKE_GENERATOR_ARGS%
endlocal
if defined USE_GCOV (
C:\msys64\usr\bin\bash -lc "cd /c/projects/neovim; bash <(curl -s https://codecov.io/bash) -c -F oldtest || echo 'codecov upload failed.'"
)
+:: The default cpack in the PATH is not CMake
+set PATH=C:\Program Files (x86)\CMake\bin\cpack.exe;%PATH%
:: Build artifacts
cpack -G ZIP -C RelWithDebInfo
if defined APPVEYOR_REPO_TAG_NAME cpack -G NSIS -C RelWithDebInfo