OLD | NEW |
---|---|
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 glob | 6 import glob |
7 import json | 7 import json |
8 import os | 8 import os |
9 import pipes | 9 import pipes |
10 import platform | 10 import platform |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
222 """In VS2017 the PGO runtime dependencies are located in | 222 """In VS2017 the PGO runtime dependencies are located in |
223 {toolchain_root}/VC/Tools/MSVC/{x.y.z}/bin/Host{target_cpu}/{target_cpu}/, the | 223 {toolchain_root}/VC/Tools/MSVC/{x.y.z}/bin/Host{target_cpu}/{target_cpu}/, the |
224 {version_number} part is likely to change in case of a minor update of the | 224 {version_number} part is likely to change in case of a minor update of the |
225 toolchain so we don't hardcode this value here (except for the major number). | 225 toolchain so we don't hardcode this value here (except for the major number). |
226 | 226 |
227 This returns the '{toolchain_root}/VC/Tools/MSVC/{x.y.z}/bin/' path. | 227 This returns the '{toolchain_root}/VC/Tools/MSVC/{x.y.z}/bin/' path. |
228 | 228 |
229 This function should only be called when using VS2017. | 229 This function should only be called when using VS2017. |
230 """ | 230 """ |
231 assert GetVisualStudioVersion() == '2017' | 231 assert GetVisualStudioVersion() == '2017' |
232 SetEnvironmentAndGetRuntimeDllDirs() | |
brucedawson
2017/05/22 21:47:14
Placing this call here means that the environment
Sébastien Marchand
2017/05/22 22:02:59
The environment is already always set when you cal
brucedawson
2017/05/22 23:48:45
Ah - I understand.
I can see a case for calling S
Sébastien Marchand
2017/05/23 00:39:45
I'll keep this call here then, relying on GYP_MSVS
| |
232 assert ('GYP_MSVS_OVERRIDE_PATH' in os.environ) | 233 assert ('GYP_MSVS_OVERRIDE_PATH' in os.environ) |
233 vc_tools_msvc_root = os.path.join(os.environ['GYP_MSVS_OVERRIDE_PATH'], | 234 vc_tools_msvc_root = os.path.join(os.environ['GYP_MSVS_OVERRIDE_PATH'], |
234 'VC', 'Tools', 'MSVC') | 235 'VC', 'Tools', 'MSVC') |
235 for directory in os.listdir(vc_tools_msvc_root): | 236 for directory in os.listdir(vc_tools_msvc_root): |
236 if not os.path.isdir(os.path.join(vc_tools_msvc_root, directory)): | 237 if not os.path.isdir(os.path.join(vc_tools_msvc_root, directory)): |
237 continue | 238 continue |
238 if re.match('14\.\d+\.\d+', directory): | 239 if re.match('14\.\d+\.\d+', directory): |
239 return os.path.join(vc_tools_msvc_root, directory, 'bin') | 240 return os.path.join(vc_tools_msvc_root, directory, 'bin') |
240 raise Exception('Unable to find the VC tools directory.') | 241 raise Exception('Unable to find the VC tools directory.') |
241 | 242 |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
439 'copy_dlls': CopyDlls, | 440 'copy_dlls': CopyDlls, |
440 } | 441 } |
441 if len(sys.argv) < 2 or sys.argv[1] not in commands: | 442 if len(sys.argv) < 2 or sys.argv[1] not in commands: |
442 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) | 443 print >>sys.stderr, 'Expected one of: %s' % ', '.join(commands) |
443 return 1 | 444 return 1 |
444 return commands[sys.argv[1]](*sys.argv[2:]) | 445 return commands[sys.argv[1]](*sys.argv[2:]) |
445 | 446 |
446 | 447 |
447 if __name__ == '__main__': | 448 if __name__ == '__main__': |
448 sys.exit(main()) | 449 sys.exit(main()) |
OLD | NEW |