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 import json | 5 import json |
6 import os | 6 import os |
7 import pipes | 7 import pipes |
8 import shutil | 8 import shutil |
9 import subprocess | 9 import subprocess |
10 import sys | 10 import sys |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
134 'get_toolchain_if_necessary.py'), | 134 'get_toolchain_if_necessary.py'), |
135 '--output-json', json_data_file, | 135 '--output-json', json_data_file, |
136 ] + _GetDesiredVsToolchainHashes() | 136 ] + _GetDesiredVsToolchainHashes() |
137 subprocess.check_call(get_toolchain_args) | 137 subprocess.check_call(get_toolchain_args) |
138 | 138 |
139 return 0 | 139 return 0 |
140 | 140 |
141 | 141 |
142 def GetToolchainDir(): | 142 def GetToolchainDir(): |
143 """Gets location information about the current toolchain (must have been | 143 """Gets location information about the current toolchain (must have been |
144 previously updated by 'update').""" | 144 previously updated by 'update').""" |
scottmg
2014/05/28 17:42:21
Add a comment that this is used for GN here (I cou
| |
145 SetEnvironmentAndGetRuntimeDllDirs() | 145 SetEnvironmentAndGetRuntimeDllDirs() |
146 print '["%s", "%s"]' % ( | 146 print """vs_path = "%s" |
brettw
2014/05/28 05:29:55
I wasn't sure how to wrap this.
scottmg
2014/05/28 17:42:21
""" -> '''
| |
147 os.environ['GYP_MSVS_OVERRIDE_PATH'], os.environ['WINDOWSSDKDIR']) | 147 sdk_path = "%s" |
148 vs_version = "%s" | |
149 wdk_dir = "%s" | |
150 """ % ( | |
151 os.environ['GYP_MSVS_OVERRIDE_PATH'], | |
152 os.environ['WINDOWSSDKDIR'], | |
153 os.environ['GYP_MSVS_VERSION'], | |
154 os.environ['WDK_DIR']) | |
148 | 155 |
149 | 156 |
150 def main(): | 157 def main(): |
151 if not sys.platform.startswith(('win32', 'cygwin')): | 158 if not sys.platform.startswith(('win32', 'cygwin')): |
152 return 0 | 159 return 0 |
153 commands = { | 160 commands = { |
154 'update': Update, | 161 'update': Update, |
155 'get_toolchain_dir': GetToolchainDir, | 162 'get_toolchain_dir': GetToolchainDir, |
156 # TODO(scottmg): Add copy_dlls for GN builds (gyp_chromium calls | 163 # TODO(scottmg): Add copy_dlls for GN builds (gyp_chromium calls |
157 # CopyVsRuntimeDlls via import, currently). | 164 # CopyVsRuntimeDlls via import, currently). |
158 } | 165 } |
159 if len(sys.argv) < 2 or sys.argv[1] not in commands: | 166 if len(sys.argv) < 2 or sys.argv[1] not in commands: |
160 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) | 167 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) |
161 return 1 | 168 return 1 |
162 return commands[sys.argv[1]]() | 169 return commands[sys.argv[1]]() |
163 | 170 |
164 | 171 |
165 if __name__ == '__main__': | 172 if __name__ == '__main__': |
166 sys.exit(main()) | 173 sys.exit(main()) |
OLD | NEW |