Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(818)

Side by Side Diff: build/vs_toolchain.py

Issue 1580703002: Ensure GYP_MSVS_VERSION is set for GN build. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The Chromium Authors. All rights reserved. 2 # Copyright 2014 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 import json 6 import json
7 import os 7 import os
8 import pipes 8 import pipes
9 import shutil 9 import shutil
10 import subprocess 10 import subprocess
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
100 100
101 def DetectVisualStudioPath(): 101 def DetectVisualStudioPath():
102 """Return path to the GYP_MSVS_VERSION of Visual Studio. 102 """Return path to the GYP_MSVS_VERSION of Visual Studio.
103 """ 103 """
104 104
105 # Note that this code is used from 105 # Note that this code is used from
106 # build/toolchain/win/setup_toolchain.py as well. 106 # build/toolchain/win/setup_toolchain.py as well.
107 107
108 # Default to Visual Studio 2013 for now. 108 # Default to Visual Studio 2013 for now.
109 version_as_year = os.environ.get('GYP_MSVS_VERSION', '2013') 109 version_as_year = os.environ.get('GYP_MSVS_VERSION', '2013')
110 os.environ['GYP_MSVS_VERSION'] = version_as_year
Daniel Bratell 2016/01/12 08:42:02 From a code maintenance point of view it doesn't s
110 year_to_version = { 111 year_to_version = {
111 '2013': '12.0', 112 '2013': '12.0',
112 '2015': '14.0', 113 '2015': '14.0',
113 } 114 }
114 if version_as_year not in year_to_version: 115 if version_as_year not in year_to_version:
115 raise Exception(('Visual Studio version %s (from GYP_MSVS_VERSION)' 116 raise Exception(('Visual Studio version %s (from GYP_MSVS_VERSION)'
116 ' not supported. Supported versions are: %s') % ( 117 ' not supported. Supported versions are: %s') % (
117 version_as_year, ', '.join(year_to_version.keys()))) 118 version_as_year, ', '.join(year_to_version.keys())))
118 version = year_to_version[version_as_year] 119 version = year_to_version[version_as_year]
119 keys = [r'HKLM\Software\Microsoft\VisualStudio\%s' % version, 120 keys = [r'HKLM\Software\Microsoft\VisualStudio\%s' % version,
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 'copy_dlls': CopyDlls, 326 'copy_dlls': CopyDlls,
326 } 327 }
327 if len(sys.argv) < 2 or sys.argv[1] not in commands: 328 if len(sys.argv) < 2 or sys.argv[1] not in commands:
328 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) 329 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands)
329 return 1 330 return 1
330 return commands[sys.argv[1]](*sys.argv[2:]) 331 return commands[sys.argv[1]](*sys.argv[2:])
331 332
332 333
333 if __name__ == '__main__': 334 if __name__ == '__main__':
334 sys.exit(main()) 335 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698