| OLD | NEW |
| 1 # Copyright (c) 2013 Google Inc. All rights reserved. | 1 # Copyright (c) 2013 Google Inc. 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 """Handle version information related to Visual Stuio.""" | 5 """Handle version information related to Visual Stuio.""" |
| 6 | 6 |
| 7 import errno | 7 import errno |
| 8 import os | 8 import os |
| 9 import re | 9 import re |
| 10 import subprocess | 10 import subprocess |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'): | 89 os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'): |
| 90 # VS2013 non-Express has a x64-x86 cross that we want to prefer. | 90 # VS2013 non-Express has a x64-x86 cross that we want to prefer. |
| 91 return [os.path.normpath( | 91 return [os.path.normpath( |
| 92 os.path.join(self.path, 'VC/vcvarsall.bat')), 'amd64_x86'] | 92 os.path.join(self.path, 'VC/vcvarsall.bat')), 'amd64_x86'] |
| 93 # Otherwise, the standard x86 compiler. | 93 # Otherwise, the standard x86 compiler. |
| 94 return [os.path.normpath( | 94 return [os.path.normpath( |
| 95 os.path.join(self.path, 'Common7/Tools/vsvars32.bat'))] | 95 os.path.join(self.path, 'Common7/Tools/vsvars32.bat'))] |
| 96 else: | 96 else: |
| 97 assert target_arch == 'x64' | 97 assert target_arch == 'x64' |
| 98 arg = 'x86_amd64' | 98 arg = 'x86_amd64' |
| 99 if (os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or | 99 # Use the 64-on-64 compiler if we're not using an express |
| 100 # edition and we're running on a 64bit OS. |
| 101 if self.short_name[-1] != 'e' and ( |
| 102 os.environ.get('PROCESSOR_ARCHITECTURE') == 'AMD64' or |
| 100 os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'): | 103 os.environ.get('PROCESSOR_ARCHITEW6432') == 'AMD64'): |
| 101 # Use the 64-on-64 compiler if we can. | |
| 102 arg = 'amd64' | 104 arg = 'amd64' |
| 103 return [os.path.normpath( | 105 return [os.path.normpath( |
| 104 os.path.join(self.path, 'VC/vcvarsall.bat')), arg] | 106 os.path.join(self.path, 'VC/vcvarsall.bat')), arg] |
| 105 | 107 |
| 106 | 108 |
| 107 def _RegistryQueryBase(sysdir, key, value): | 109 def _RegistryQueryBase(sysdir, key, value): |
| 108 """Use reg.exe to read a particular key. | 110 """Use reg.exe to read a particular key. |
| 109 | 111 |
| 110 While ideally we might use the win32 module, we would like gyp to be | 112 While ideally we might use the win32 module, we would like gyp to be |
| 111 python neutral, so for instance cygwin python lacks this module. | 113 python neutral, so for instance cygwin python lacks this module. |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 return _CreateVersion(msvs_version, override_path, sdk_based=True) | 400 return _CreateVersion(msvs_version, override_path, sdk_based=True) |
| 399 version = str(version) | 401 version = str(version) |
| 400 versions = _DetectVisualStudioVersions(version_map[version], 'e' in version) | 402 versions = _DetectVisualStudioVersions(version_map[version], 'e' in version) |
| 401 if not versions: | 403 if not versions: |
| 402 if version == 'auto': | 404 if version == 'auto': |
| 403 # Default to 2005 if we couldn't find anything | 405 # Default to 2005 if we couldn't find anything |
| 404 return _CreateVersion('2005', None) | 406 return _CreateVersion('2005', None) |
| 405 else: | 407 else: |
| 406 return _CreateVersion(version, None) | 408 return _CreateVersion(version, None) |
| 407 return versions[0] | 409 return versions[0] |
| OLD | NEW |