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 | |
| 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
| -rw-r--r-- | build.cmd | 90 | ||||
| -rw-r--r-- | xeon.vcxproj | 22 |
2 files changed, 110 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 +) diff --git a/xeon.vcxproj b/xeon.vcxproj new file mode 100644 index 0000000..eae4ea7 --- /dev/null +++ b/xeon.vcxproj @@ -0,0 +1,22 @@ +<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.default.props" /> + <PropertyGroup> + <ConfigurationType>Application</ConfigurationType> + <PlatformToolset>$(toolVersion)</PlatformToolset> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ItemGroup> + <ClCompile Include="main.cpp" /> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Targets" /> +</Project>
\ No newline at end of file |
