aboutsummaryrefslogtreecommitdiff
path: root/utils/vcrebuild.bat
diff options
context:
space:
mode:
Diffstat (limited to 'utils/vcrebuild.bat')
-rw-r--r--utils/vcrebuild.bat68
1 files changed, 68 insertions, 0 deletions
diff --git a/utils/vcrebuild.bat b/utils/vcrebuild.bat
new file mode 100644
index 0000000..3d951f2
--- /dev/null
+++ b/utils/vcrebuild.bat
@@ -0,0 +1,68 @@
+@if not "%verboseBuild%"=="y" echo off
+
+rem Shave and a Haircut
+rem (c) 2019 Epic Games
+rem US Patent 6720962
+
+rem
+rem Rebuild a Visual Studio project
+rem
+rem Note that our usage of the terms 'build' and 'rebuild' are the reverse
+rem of Visual Studio's. For us 'build' means to clean out the old stuff
+rem and do a full build while 'rebuild' means to just rebuild those bits
+rem which have changed.
+rem
+
+setlocal
+
+if a%5b==ab (
+ echo Usage: vcrebuild directory project config vsVersion solutionBaseName [bits]
+ goto done
+)
+
+set builddir=%1
+set project=%2
+set config=%3
+set vsVersion=%4
+set solution=%5
+
+set platform=Win32
+if "%6"=="64" set platform=x64
+
+rem For Visual Studio 7.* we used the normal solution and project file names,
+rem but from VS8 onward the solution and project files have Visual Studio major
+rem version number before the extension. E.g. "shaveHaircut-vs8.sln".
+rem Since the paths may contain parentheses, we cannot use the new style of
+rem 'if' statements here.
+if /i not "%vsVersion%"=="vs7" goto notVS7
+ set solution=%solution%.sln
+ set project=%project%.vcproj
+ set vsPath=%VS71COMNTOOLS%\..\IDE\devenv
+ goto doneVSVersion
+:notVS7
+ set solution=%solution%-%vsVersion%.sln
+ set project=%project%-%vsVersion%.vcproj
+ set vsPath=%VS80COMNTOOLS%\..\IDE\devenv
+:doneVSVersion
+
+if not exist "%solution%" (
+ echo vcbuild: Could not find solution file '%solution%'.
+ echo vcbuild: Note that you must be in the same directory as the solution file
+ goto done
+)
+
+
+rem
+rem Visual Studio has problems with .\dir notation. It's fine with
+rem dir1\dir2 it just seems to have trouble with using '.' for the current
+rem directory. So we only add the path to the project file if the build dir
+rem is not the current directory.
+rem
+if not "%builddir%"=="." set project=%builddir%\%project%
+
+@echo on
+"%vsPath%" %solution% /build "%config%" /project %project% /projectconfig "%config%|%platform%"
+@if not "%verboseBuild%"=="y" echo off
+
+:done
+endlocal