forked from GPUOpen-Tools/compressonator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathBuildGUI.bat
128 lines (121 loc) · 5.31 KB
/
BuildGUI.bat
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
@echo off
::-----------------------------------------------------------------
:: Build file for Compressonator CLI - May 4 2016
::
::
:: Syntax for this batch file
::
::
:: Revision History
::-----------------------------------------------------------------
:: Set this to 1 if you want VS2015 builds else leave it equal to blank
set BUILD2015=1
echo ------------------------------------------------------------------------------
echo Save Start folder at Perforce ROOT or subfolder AMD_Compress
echo ------------------------------------------------------------------------------
set BatchDir=%CD%
echo --1
IF EXIST %BatchDir%\Compressonator (set COMPRESSONATOR_ROOT=%CD%\Compressonator)
IF EXIST %BatchDir%\Common (set COMMON_ROOT=%CD%\Common)
IF [%COMPRESSONATOR_ROOT%]==[] (set COMPRESSONATOR_ROOT=%CD%)
echo --2
echo -------------------------------------------------------------------------------
echo Output Log File
echo -------------------------------------------------------------------------------
set OUTPUT_LOG=%BatchDir%\output.log
echo -----------------------------------------------------------------------------
echo Check for MSBUILD existence based on Version 12.0 (MSBUILD SDK installs)
echo -----------------------------------------------------------------------------
set Building="Check Missing MSBUILD v12 -----------------------"
echo --1
echo %Building% >> %OUTPUT_LOG%
echo --2
reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0" /v MSBuildToolsPath > nul 2>&1
if ERRORLEVEL 1 goto MSBuildTest2
echo --3
for /f "skip=2 tokens=2,*" %%A in ('reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0" /v MSBuildToolsPath') do SET MSBUILDDIR=%%B
IF NOT EXIST "%MSBUILDDIR%msbuild.exe" goto MSBuildTest2
echo --4
set PATH=%MSBUILDDIR%;%PATH%
echo --5
echo -----------------------------------------------------------------------------
echo Get MSBUILD prop path for VS2010
echo -----------------------------------------------------------------------------
reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0" /v MSBuildToolsRoot > nul 2>&1
if ERRORLEVEL 1 goto MSBuildTest2
echo --1
for /f "skip=2 tokens=2,*" %%A in ('reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\12.0" /v MSBuildToolsRoot') do SET MSBUILDROOT=%%B
echo --2
set PATH=%MSBUILDROOT%\Microsoft.Cpp\v4.0\;%PATH%
echo -----------------------------------------------------------------------------
echo Set MSBUILD prop path for VS2012, VS2013, VS2015
echo -----------------------------------------------------------------------------
set PATH=%MSBUILDROOT%\Microsoft.Cpp\v4.0\V110\;%MSBUILDROOT%\Microsoft.Cpp\v4.0\V120\;%MSBUILDROOT%\Microsoft.Cpp\v4.0\V140\;%PATH%
echo --1
PATH >> %OUTPUT_LOG%
echo --2
goto RunBatch:
echo --------------------------------------------------------------------
echo Check for MSBUILD existence based on Version 4.0 (.Net installs)
echo --------------------------------------------------------------------
:MSBuildTest2
echo --1
set Building="Check Missing MSBUILD v4 -----------------------"
echo --2
echo %Building% >> %OUTPUT_LOG%
echo --3
reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" /v MSBuildToolsPath > nul 2>&1
if ERRORLEVEL 1 goto Error
echo --4
for /f "skip=2 tokens=2,*" %%A in ('reg.exe query "HKLM\SOFTWARE\Microsoft\MSBuild\ToolsVersions\4.0" /v MSBuildToolsPath') do SET MSBUILDDIR=%%B
echo --5
IF NOT EXIST "%MSBUILDDIR%msbuild.exe" goto Error
echo --6
set PATH=%MSBUILDDIR%;%PATH%
::--------------------------------------------------------------------
:: THE FOLLOWING ARE NOT CHECKED FOR based on older (.Net installs)
:: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\2.0
:: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSBuild\ToolsVersions\3.5
::--------------------------------------------------------------------
echo -------------------------------------------------------
echo Set ENVIORONMENT variables and build type
echo -------------------------------------------------------
:RunBatch
echo --1
set ORIG_PATH=%PATH%
echo --2
set Building="Set Enviornment Variables - Please check -----------------------"
echo --3
echo %Building% >> %OUTPUT_LOG%
::
echo ------------------------------------------------------------
echo VS2015 Build Compressonator GUI Exe
echo ------------------------------------------------------------
cd %COMPRESSONATOR_ROOT%\Applications\CompressonatorGUI\VS2015
::
set Building="STEP a2: VS2015 Build CompressonatorGUI Win32:Release_MD -----------------------"
echo --1
echo %Building% >> %OUTPUT_LOG%
echo --2
MSBUILD VS2015.sln /p:Configuration=release_md /t:rebuild /p:Platform=win32 /p:VCTargetsPath="%MSBUILDROOT%\Microsoft.Cpp\v4.0\V140/" >> %OUTPUT_LOG%
IF %ERRORLEVEL% GTR 0 goto Error
::
Goto Done
:Error
::
echo ----------------------------------------------------------- >> %OUTPUT_LOG%
echo ***** !!Build Failed!! for %Building% >> %OUTPUT_LOG%
echo ***** MSBuild Exit Error = %errorlevel% >> %OUTPUT_LOG%
echo ------------------------------------------------------------ >> %OUTPUT_LOG%
::
cd %BatchDir%
echo "BUILD FAILED"
exit /b %ERRORLEVEL%
:Done
:: ---------------------------------------------------
:: Build DONE return to original start folder
:: ---------------------------------------------------
echo "BUILD PASSED" >> %OUTPUT_LOG%
cd %BatchDir%
echo "BUILD PASSED"
:Finish