From cfb713b5c6a3cde25e12ffba87b488105d82c76a Mon Sep 17 00:00:00 2001 From: b-r-o-c-k Date: Sun, 4 Mar 2018 17:44:23 -0600 Subject: build/msvc: Add Appveyor CI for MSVC --- ci/build.bat | 50 +++++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 21 deletions(-) (limited to 'ci') diff --git a/ci/build.bat b/ci/build.bat index 5c7f14ad0a..60bd152192 100644 --- a/ci/build.bat +++ b/ci/build.bat @@ -1,27 +1,33 @@ -:: 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%" == "MINGW_64" ( set ARCH=x86_64 set BITS=64 -) -if "%CONFIGURATION%" == "MINGW_64-gcov" ( +) else 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" ) -:: 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:detailed +) :: Setup python (use AppVeyor system python) C:\Python27\python.exe -m pip install neovim || goto :error @@ -42,19 +48,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 +69,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 -- cgit From 7612ba5ad9f358722638e78fec8f45cb82545dca Mon Sep 17 00:00:00 2001 From: b-r-o-c-k Date: Mon, 5 Mar 2018 11:00:01 -0600 Subject: build/msvc: Change MSBuild verbosity to normal --- ci/build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'ci') diff --git a/ci/build.bat b/ci/build.bat index 60bd152192..7bedc19195 100644 --- a/ci/build.bat +++ b/ci/build.bat @@ -26,7 +26,7 @@ if "%CONFIGURATION:~0,5%" == "MINGW" ( 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:detailed + set CMAKE_GENERATOR_ARGS=/verbosity:normal ) :: Setup python (use AppVeyor system python) -- cgit From 0adf950ccf9a0057c552a349d79a716ff7be6f8f Mon Sep 17 00:00:00 2001 From: b-r-o-c-k Date: Wed, 7 Mar 2018 11:07:07 -0600 Subject: build/msvc: Fix AppVeyor build script for 'MINGW_64-gcov' configuration --- ci/build.bat | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ci') diff --git a/ci/build.bat b/ci/build.bat index 7bedc19195..3fa185f646 100644 --- a/ci/build.bat +++ b/ci/build.bat @@ -2,11 +2,12 @@ echo on if "%CONFIGURATION%" == "MINGW_32" ( set ARCH=i686 set BITS=32 -) else if "%CONFIGURATION%" == "MINGW_64" ( +) else if "%CONFIGURATION:~0,8%" == "MINGW_64" ( set ARCH=x86_64 set BITS=64 -) else if "%CONFIGURATION%" == "MINGW_64-gcov" ( - set USE_GCOV="-DUSE_GCOV=ON" + 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" ( -- cgit