Update build.bat

This commit is contained in:
William McVicar
2024-01-06 23:28:26 +01:00
parent 40cf350b72
commit a999152e1d

View File

@@ -1,5 +1,25 @@
@echo off @echo off
SET DEFAULT_INSTALL_DIR=%USERPROFILE%\apps\nvim
SET INSTALL_DIR=%DEFAULT_INSTALL_DIR%
:PARSE_ARGS
IF "%~1" == "" (
goto END_PARSE
)
IF "%~1" == "--help" (
ECHO Parameters:
ECHO --clean: Deletes an existing neovim directory forcing a new one to be pulled from Github
ECHO --install_dir "<directory>" Specifies that the neovim binary data will be copied to "<directory>" after its built
ECHO:
ECHO If "<directory>" is empty of --install_dir isn't passed at all then the data will be copied to
ECHO the default dir %USERPROFILE%\apps\nvim
GOTO EXIT
)
IF "%~1" == "--clean" ( IF "%~1" == "--clean" (
PUSHD .. PUSHD ..
IF EXIST "neovim" ( IF EXIST "neovim" (
@@ -9,6 +29,18 @@ IF "%~1" == "--clean" (
POPD POPD
) )
IF "%~1" == "--install_dir" (
IF "%~2" == "" (
ECHO A directory to install neovim into is required. Using Default Path %DEFAULT_INSTALL_DIR%
SET INSTALL_DIR=%DEFAULT_INSTALL_DIR%
) ELSE (
SET INSTALL_DIR="%~2"
)
)
SHIFT
GOTO PARSE_ARGS
:END_PARSE
PUSHD .. PUSHD ..
IF NOT EXIST "neovim" ( IF NOT EXIST "neovim" (
git clone https://github.com/neovim/neovim.git git clone https://github.com/neovim/neovim.git
@@ -16,11 +48,15 @@ IF NOT EXIST "neovim" (
PUSHD neovim PUSHD neovim
cmake -S cmake.deps -B .deps -D CMAKE_BUILD_TYPE=Release cmake -S cmake.deps -B .deps
cmake --build .deps --config Release cmake --build .deps --config Release
cmake -S . -B build -D CMAKE_BUILD_TYPE=Release cmake -S . -B build
cmake --build build --config Release cmake --build build --config Release
cmake --install build --config Release --prefix "C:\Program Files\nvim"
ECHO installing into %INSTALL_DIR%
cmake --install build --config Release --prefix %INSTALL_DIR%
POPD POPD
PUSHD get-and-build-nvim-windows PUSHD get-and-build-nvim-windows
:EXIT