blob: 840581f843e18331966830f895b155855f9b6cb8 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
|
@echo off
title Building C++ Program
echo Building Program...
echo Shell: CMD
if exist default-msbuild.txt goto msBuild
:findmingw
set mingwPath=0
if exist "C:\MinGW" (
set "mingwPath=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
cls
goto msBuild
)
if exist out (
echo Skipping making the "out" folder...
) else (
mkdir out
echo Created the "out" folder..
)
g++ --version
g++ -g main.cpp -o out/game.exe
echo Building Complete!
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
)
|