forked from gisinternals/buildsystem
-
Notifications
You must be signed in to change notification settings - Fork 0
/
makevc11x64sdk.bat
136 lines (104 loc) · 4.5 KB
/
makevc11x64sdk.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
129
130
131
132
133
134
135
@echo Setting environment for using Microsoft Visual Studio 2012 x64 tools.
@call :GetVSCommonToolsDir
@if "%VS110COMNTOOLS%"=="" goto error_no_VS110COMNTOOLSDIR
@call "%VS110COMNTOOLS%VCVarsQueryRegistry.bat" No32bit 64bit
@if "%VSINSTALLDIR%"=="" goto error_no_VSINSTALLDIR
@if "%VCINSTALLDIR%"=="" goto error_no_VCINSTALLDIR
@if "%FrameworkDir64%"=="" goto error_no_FrameworkDIR64
@if "%FrameworkVersion64%"=="" goto error_no_FrameworkVer64
@if "%Framework35Version%"=="" goto error_no_Framework35Version
@set FrameworkDir=%FrameworkDir64%
@set FrameworkVersion=%FrameworkVersion64%
@if not "%WindowsSdkDir_old%" == "" (
@set "PATH=%WindowsSdkDir_old%bin\NETFX 4.0 Tools\x64;%WindowsSdkDir_35%x64;%WindowsSdkDir_old%bin\NETFX 4.0 Tools;%WindowsSdkDir_35%;%PATH%"
)
@if not "%WindowsSdkDir%" == "" (
@set "PATH=%WindowsSdkDir%bin\x64;%WindowsSdkDir%bin\x86;%PATH%"
@set "INCLUDE=%WindowsSdkDir%include\shared;%WindowsSdkDir%include\um;%WindowsSdkDir%include\winrt;%INCLUDE%"
@set "LIB=%WindowsSdkDir%lib\win8\um\x64;%LIB%"
@set "LIBPATH=%WindowsSdkDir%References\CommonConfiguration\Neutral;%ExtensionSDKDir%\Microsoft.VCLibs\11.0\References\CommonConfiguration\neutral;%LIBPATH%"
)
@rem PATH
@rem ----
@if exist "%VSINSTALLDIR%Team Tools\Performance Tools\x64" (
@set "PATH=%VSINSTALLDIR%Team Tools\Performance Tools\x64;%VSINSTALLDIR%Team Tools\Performance Tools;%PATH%"
)
@if exist "%ProgramFiles%\HTML Help Workshop" set PATH=%ProgramFiles%\HTML Help Workshop;%PATH%
@if exist "%ProgramFiles(x86)%\HTML Help Workshop" set PATH=%ProgramFiles(x86)%\HTML Help Workshop;%PATH%
@set PATH=%VSINSTALLDIR%Common7\Tools;%PATH%
@set PATH=%VSINSTALLDIR%Common7\IDE;%PATH%
@set PATH=%VCINSTALLDIR%VCPackages;%PATH%
@set PATH=%FrameworkDir%\%Framework35Version%;%PATH%
@set PATH=%FrameworkDir%\%FrameworkVersion%;%PATH%
@set PATH=%VCINSTALLDIR%BIN\amd64;%PATH%
@if exist "%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\TestWindow" (
@set "PATH=%VSINSTALLDIR%Common7\IDE\CommonExtensions\Microsoft\TestWindow;%PATH%"
)
@rem INCLUDE
@rem -------
@if exist "%VCINSTALLDIR%ATLMFC\INCLUDE" set INCLUDE=%VCINSTALLDIR%ATLMFC\INCLUDE;%INCLUDE%
@set INCLUDE=%VCINSTALLDIR%INCLUDE;%INCLUDE%
@set "INCLUDE=%INCLUDE%;C:\Program Files\Microsoft SDKs\Windows\v6.0A\include"
@rem LIB
@rem ---
@if exist "%VCINSTALLDIR%ATLMFC\LIB\amd64" set LIB=%VCINSTALLDIR%ATLMFC\LIB\amd64;%LIB%
@set LIB=%VCINSTALLDIR%LIB\amd64;%LIB%
@rem LIBPATH
@rem -------
@if exist "%VCINSTALLDIR%ATLMFC\LIB\amd64" set LIBPATH=%VCINSTALLDIR%ATLMFC\LIB\amd64;%LIBPATH%
@set LIBPATH=%VCINSTALLDIR%LIB\amd64;%LIBPATH%
@set LIBPATH=%FrameworkDir%\%Framework35Version%;%LIBPATH%
@set LIBPATH=%FrameworkDir%\%FrameworkVersion%;%LIBPATH%
@set Platform=X64
@set CommandPromptType=Native
@goto end
@REM -----------------------------------------------------------------------
:GetVSCommonToolsDir
@set VS110COMNTOOLS=
@call :GetVSCommonToolsDirHelper32 HKLM > nul 2>&1
@if errorlevel 1 call :GetVSCommonToolsDirHelper32 HKCU > nul 2>&1
@if errorlevel 1 call :GetVSCommonToolsDirHelper64 HKLM > nul 2>&1
@if errorlevel 1 call :GetVSCommonToolsDirHelper64 HKCU > nul 2>&1
@exit /B 0
:GetVSCommonToolsDirHelper32
@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "11.0"') DO (
@if "%%i"=="11.0" (
@SET "VS110COMNTOOLS=%%k"
)
)
@if "%VS110COMNTOOLS%"=="" exit /B 1
@SET "VS110COMNTOOLS=%VS110COMNTOOLS%Common7\Tools\"
@exit /B 0
:GetVSCommonToolsDirHelper64
@for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\SxS\VS7" /v "11.0"') DO (
@if "%%i"=="11.0" (
@SET "VS110COMNTOOLS=%%k"
)
)
@if "%VS110COMNTOOLS%"=="" exit /B 1
@SET "VS110COMNTOOLS=%VS110COMNTOOLS%Common7\Tools\"
@exit /B 0
@REM -----------------------------------------------------------------------
:error_no_VS110COMNTOOLSDIR
@echo ERROR: Cannot determine the location of the VS Common Tools folder.
@goto end
:error_no_VSINSTALLDIR
@echo ERROR: Cannot determine the location of the VS installation.
@goto end
:error_no_VCINSTALLDIR
@echo ERROR: Cannot determine the location of the VC installation.
@goto end
:error_no_FrameworkDIR64
@echo ERROR: Cannot determine the location of the .NET Framework 64bit installation.
@goto end
:error_no_FrameworkVer64
@echo ERROR: Cannot determine the version of the .NET Framework 64bit installation.
@goto end
:error_no_Framework35Version
@echo ERROR: Cannot determine the .NET Framework 3.5 version.
@goto end
:end
set compiler=vc11x64
set nmakecmd=full-rebuild
set logid=%compiler%-dev
nmake %nmakecmd% >%logid%.txt 2>%logid%-err.txt