Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright 2014 The Chromium Authors. All rights reserved. | 1 # Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 """ | 5 """ |
| 6 From a system-installed copy of the toolchain, packages all the required bits | 6 From a system-installed copy of the toolchain, packages all the required bits |
| 7 into a .zip file. | 7 into a .zip file. |
| 8 | 8 |
| 9 It assumes default install locations for tools, in particular: | 9 It assumes default install locations for tools, in particular: |
| 10 - C:\Program Files (x86)\Microsoft Visual Studio 12.0\... | 10 - C:\Program Files (x86)\Microsoft Visual Studio 12.0\... |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 180 do it here manually since we do not do a full install.""" | 180 do it here manually since we do not do a full install.""" |
| 181 with open(os.path.join( | 181 with open(os.path.join( |
| 182 target_dir, r'win_sdk\bin\SetEnv.cmd'), 'w') as f: | 182 target_dir, r'win_sdk\bin\SetEnv.cmd'), 'w') as f: |
| 183 f.write('@echo off\n' | 183 f.write('@echo off\n' |
| 184 ':: Generated by win_toolchain\\package_from_installed.py.\n' | 184 ':: Generated by win_toolchain\\package_from_installed.py.\n' |
| 185 # Common to x86 and x64 | 185 # Common to x86 and x64 |
| 186 'set VSINSTALLDIR=%~dp0..\\..\\\n' | 186 'set VSINSTALLDIR=%~dp0..\\..\\\n' |
| 187 'set VCINSTALLDIR=%~dp0..\\..\\VC\\\n' | 187 'set VCINSTALLDIR=%~dp0..\\..\\VC\\\n' |
| 188 'set PATH=%~dp0..\\..\\Common7\\IDE;%PATH%\n' | 188 'set PATH=%~dp0..\\..\\Common7\\IDE;%PATH%\n' |
| 189 'set INCLUDE=%~dp0..\\..\\win_sdk\\Include\\WINVERSION\\um;' | 189 'set INCLUDE=%~dp0..\\..\\win_sdk\\Include\\WINVERSION\\um;' |
| 190 '%~dp0..\\..\\win_sdk\\Include\\WINVERSION\\shared;' | 190 '%~dp0..\\..\\win_sdk\\Include\\WINVERSION\\shared;' |
| 191 '%~dp0..\\..\\win_sdk\\Include\\WINVERSION\\winrt;' | 191 '%~dp0..\\..\\win_sdk\\Include\\WINVERSION\\winrt;'.replace( |
| 192 '%~dp0..\\..\\win_sdk\\Include\\WINVERSION\\ucrt;' # VS 2015 | 192 'WINVERSION', WIN_VERSION)) |
| 193 '%~dp0..\\..\\VC\\include;' | 193 if VS_VERSION == '2015': |
| 194 '%~dp0..\\..\\VC\\atlmfc\\include\n' | 194 f.write('%~dp0..\\..\\win_sdk\\Include\\WINVERSION\\ucrt;'.replace( |
| 195 'if "%1"=="/x64" goto x64\n'.replace('WINVERSION', WIN_VERSION)) | 195 'WINVERSION', WIN_VERSION)) |
|
brucedawson
2016/02/03 18:56:51
Ah crap. I accidentally deleted this whole line wh
| |
| 196 f.write('%~dp0..\\..\\VC\\include;' | |
| 197 '%~dp0..\\..\\VC\\atlmfc\\include\n') | |
| 196 | 198 |
| 197 # x86. Always use amd64_x86 cross, not x86 on x86. | 199 # x86. Always use amd64_x86 cross, not x86 on x86. |
| 198 f.write('set PATH=%~dp0..\\..\\win_sdk\\bin\\x86;' | 200 f.write('set PATH=%~dp0..\\..\\win_sdk\\bin\\x86;' |
| 199 '%~dp0..\\..\\VC\\bin\\amd64_x86;' | 201 '%~dp0..\\..\\VC\\bin\\amd64_x86;' |
| 200 '%~dp0..\\..\\VC\\bin\\amd64;' # Needed for mspdb1x0.dll. | 202 '%~dp0..\\..\\VC\\bin\\amd64;' # Needed for mspdb1x0.dll. |
| 201 '%PATH%\n') | 203 '%PATH%\n') |
| 202 f.write('set LIB=%~dp0..\\..\\VC\\lib;' | 204 f.write('set LIB=%~dp0..\\..\\VC\\lib;' |
| 203 '%~dp0..\\..\\win_sdk\\Lib\\WINVERSION\\um\\x86;' | 205 '%~dp0..\\..\\win_sdk\\Lib\\WINVERSION\\um\\x86;' |
| 204 '%~dp0..\\..\\win_sdk\\Lib\\WINVERSION\\ucrt\\x86;' # VS 2015 | 206 '%~dp0..\\..\\win_sdk\\Lib\\WINVERSION\\ucrt\\x86;' # VS 2015 |
|
scottmg
2016/01/21 00:50:49
This too?
brucedawson
2016/01/21 00:55:49
Well, technically. The downside is it requires ugl
scottmg
2016/01/21 00:59:39
OK. We should delete WINVERSION after we switch an
| |
| 205 '%~dp0..\\..\\VC\\atlmfc\\lib\n' | 207 '%~dp0..\\..\\VC\\atlmfc\\lib\n' |
| 206 'goto :EOF\n'.replace('WINVERSION', WIN_VERSION)) | 208 'goto :EOF\n'.replace('WINVERSION', WIN_VERSION)) |
| 207 | 209 |
| 208 # x64. | 210 # x64. |
| 209 f.write(':x64\n' | 211 f.write(':x64\n' |
| 210 'set PATH=%~dp0..\\..\\win_sdk\\bin\\x64;' | 212 'set PATH=%~dp0..\\..\\win_sdk\\bin\\x64;' |
| 211 '%~dp0..\\..\\VC\\bin\\amd64;' | 213 '%~dp0..\\..\\VC\\bin\\amd64;' |
| 212 '%PATH%\n') | 214 '%PATH%\n') |
| 213 f.write('set LIB=%~dp0..\\..\\VC\\lib\\amd64;' | 215 f.write('set LIB=%~dp0..\\..\\VC\\lib\\amd64;' |
| 214 '%~dp0..\\..\\win_sdk\\Lib\\WINVERSION\\um\\x64;' | 216 '%~dp0..\\..\\win_sdk\\Lib\\WINVERSION\\um\\x64;' |
| 215 '%~dp0..\\..\\win_sdk\\Lib\\WINVERSION\\ucrt\\x64;' # VS 2015 | 217 '%~dp0..\\..\\win_sdk\\Lib\\WINVERSION\\ucrt\\x64;' # VS 2015 |
|
scottmg
2016/01/21 00:50:49
And here
| |
| 216 '%~dp0..\\..\\VC\\atlmfc\\lib\\amd64\n' | 218 '%~dp0..\\..\\VC\\atlmfc\\lib\\amd64\n' |
| 217 .replace('WINVERSION', WIN_VERSION)) | 219 .replace('WINVERSION', WIN_VERSION)) |
| 218 | 220 |
| 219 | 221 |
| 220 def AddEnvSetup(files): | 222 def AddEnvSetup(files): |
| 221 """We need to generate this file in the same way that the "from pieces" | 223 """We need to generate this file in the same way that the "from pieces" |
| 222 script does, so pull that in here.""" | 224 script does, so pull that in here.""" |
| 223 tempdir = tempfile.mkdtemp() | 225 tempdir = tempfile.mkdtemp() |
| 224 os.makedirs(os.path.join(tempdir, 'win_sdk', 'bin')) | 226 os.makedirs(os.path.join(tempdir, 'win_sdk', 'bin')) |
| 225 GenerateSetEnvCmd(tempdir) | 227 GenerateSetEnvCmd(tempdir) |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 319 sys.stdout.write('\rWrote to %s.%s\n' % (output, ' '*50)) | 321 sys.stdout.write('\rWrote to %s.%s\n' % (output, ' '*50)) |
| 320 sys.stdout.flush() | 322 sys.stdout.flush() |
| 321 | 323 |
| 322 RenameToSha1(output) | 324 RenameToSha1(output) |
| 323 | 325 |
| 324 return 0 | 326 return 0 |
| 325 | 327 |
| 326 | 328 |
| 327 if __name__ == '__main__': | 329 if __name__ == '__main__': |
| 328 sys.exit(main()) | 330 sys.exit(main()) |
| OLD | NEW |