From a999152e1d13f96cf550970ebd22665739c8765c Mon Sep 17 00:00:00 2001 From: William McVicar <12842622+McMassiveNZ@users.noreply.github.com> Date: Sat, 6 Jan 2024 23:28:26 +0100 Subject: [PATCH] Update build.bat --- build.bat | 42 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/build.bat b/build.bat index 0f928e0..f55062b 100644 --- a/build.bat +++ b/build.bat @@ -1,5 +1,25 @@ @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 "" Specifies that the neovim binary data will be copied to "" after its built + ECHO: + ECHO If "" 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" ( PUSHD .. IF EXIST "neovim" ( @@ -9,6 +29,18 @@ IF "%~1" == "--clean" ( 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 .. IF NOT EXIST "neovim" ( git clone https://github.com/neovim/neovim.git @@ -16,11 +48,15 @@ IF NOT EXIST "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 -S . -B build -D CMAKE_BUILD_TYPE=Release +cmake -S . -B build 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 PUSHD get-and-build-nvim-windows + +:EXIT \ No newline at end of file