diff options
| author | Alee <Alee14498@gmail.com> | 2019-01-29 09:22:02 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-01-29 09:22:02 -0500 |
| commit | 357c6c41eacb919a0749c55eef38fc664bb7a5ad (patch) | |
| tree | 56535371120b6c178c7a3f4a91f761347589892c /build.cmd | |
| parent | da7e45bdfdf5d09c6e9ca12049a2af15dfe9877e (diff) | |
| parent | 0a2682dde21a80a41229dcd6f66efe31c5847ec1 (diff) | |
| download | Project-Xeon-357c6c41eacb919a0749c55eef38fc664bb7a5ad.tar.gz Project-Xeon-357c6c41eacb919a0749c55eef38fc664bb7a5ad.tar.bz2 Project-Xeon-357c6c41eacb919a0749c55eef38fc664bb7a5ad.zip | |
Merge pull request #2 from AdrUlb/master
Added MSBuild support
Diffstat (limited to 'build.cmd')
| -rw-r--r-- | build.cmd | 90 |
1 files changed, 88 insertions, 2 deletions
@@ -10,8 +10,10 @@ if exist "C:\MinGW" ( if "%mingwPath%"=="0" ( title Building C++ Program - Failed echo MinGW could not be found. Please make sure that MinGW is installed. + echo If you want to use MSBuild instead press enter. Otherwise close this window. pause>nul - exit + cls + goto msBuild ) if exist out ( echo Skipping making the "out" folder... @@ -22,4 +24,88 @@ echo Created the "out" folder.. g++ --version g++ -g main.cpp -o out/game.exe echo Building Complete! -pause>nul
\ No newline at end of file +pause>nul +exit + + +:msBuild +title Building C++ Program - MSBuild +echo Building using MSBuild +:findMsBuild +set msBuildPath=0 +if exist "C:\Program Files\MSBuild" ( + set "msBuildPath=C:\Program Files\MSBuild" +) +if exist "C:\Program Files (x86)\MSBuild" ( + set "msBuildPath=C:\Program Files (x86)\MSBuild" +) +if "%msBuildPath%"=="0" ( + echo MSBuild could not be found. Please make sure that MSBuild is installed. + pause>nul + exit +) + +:findMsBuildVersion +set msBuildVersion=0 +if exist "%msBuildPath%\12.0" ( + set msBuildVersion=12.0 +) +if %msBuildVersion%==0 goto manualMsBuildVersionOverride + +:findTools +echo ---------------------------------------- +echo Found MSBuild version %msBuildVersion% +echo ---------------------------------------- + +set toolVersion=0 +if exist "%msBuildPath%\Microsoft.Cpp\v4.0\V110" ( + set toolVersion=v110 +) +if exist "%msBuildPath%\Microsoft.Cpp\v4.0\V120" ( + set toolVersion=v120 +) +if "%toolVersion%"=="0" goto manualToolVersionOverride + +:setVCTargets +echo ---------------------------------------- +echo Found VCTools version %toolVersion% +echo ---------------------------------------- + +set "VCTargetsPath=%msBuildPath%\Microsoft.Cpp\v4.0\%toolVersion%" + +:build +echo Building Program... +"%msBuildPath%\%msBuildVersion%\Bin\msbuild.exe" xeon.vcxproj /p:outdir=out /p:assemblyname=game /p:configuration=release > msbuild.log +echo Building Complete! +pause>nul +exit + + + +:manualMsBuildVersionOverride +echo Could not find MSBuild 12.0 +echo Please specify the installed version manually or close this window, +echo install either of these versions and try again. +set /p manualMsBuildVersion=MSBuild version number: +set msBuildVersion=%manualmsBuildVersion% +if exist "%msBuildPath%\%manualMsBuildVersion%" ( + goto findTools +) else ( + echo Could not find MSBuild version! + pause>nul + exit +) + +:manualToolVersionOverride +echo Could not find MSBuild tools V120 or V110. +echo Please specify the version of installed tools manually +echo or close this window, install either of these versions and try again. +set /p manualToolVersion=Tool version number: +set toolVersion=v%manualToolVersion% +if exist "%msBuildPath%\Microsoft.Cpp\v4.0\%toolVersion%" ( + goto setVCTargets +) else ( + echo Could not find tool version! + pause>nul + exit +) |
