OLD | NEW |
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 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 """ | 5 """ |
6 This module helps emulate Visual Studio 2008 behavior on top of other | 6 This module helps emulate Visual Studio 2008 behavior on top of other |
7 build systems, primarily ninja. | 7 build systems, primarily ninja. |
8 """ | 8 """ |
9 | 9 |
10 import os | 10 import os |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 setattr(self, field, {}) | 160 setattr(self, field, {}) |
161 for configname, config in configs.iteritems(): | 161 for configname, config in configs.iteritems(): |
162 getattr(self, field)[configname] = config.get(field, default()) | 162 getattr(self, field)[configname] = config.get(field, default()) |
163 | 163 |
164 self.msvs_cygwin_dirs = spec.get('msvs_cygwin_dirs', ['.']) | 164 self.msvs_cygwin_dirs = spec.get('msvs_cygwin_dirs', ['.']) |
165 | 165 |
166 unsupported_fields = [ | 166 unsupported_fields = [ |
167 'msvs_prebuild', | 167 'msvs_prebuild', |
168 'msvs_postbuild', | 168 'msvs_postbuild', |
169 ] | 169 ] |
| 170 unsupported = [] |
170 for field in unsupported_fields: | 171 for field in unsupported_fields: |
171 for config in configs.values(): | 172 for config in configs.values(): |
172 if field in config: | 173 if field in config: |
173 print "Warning: %s not supported, dropping. (target %s)" \ | 174 unsupported += ["%s not supported (target %s)." % |
174 % (field, spec['target_name']) | 175 (field, spec['target_name'])] |
175 break | 176 if unsupported: |
| 177 raise Exception('\n'.join(unsupported)) |
176 | 178 |
177 def GetVSMacroEnv(self, base_to_build=None, config=None): | 179 def GetVSMacroEnv(self, base_to_build=None, config=None): |
178 """Get a dict of variables mapping internal VS macro names to their gyp | 180 """Get a dict of variables mapping internal VS macro names to their gyp |
179 equivalents.""" | 181 equivalents.""" |
180 target_platform = 'Win32' if self.GetArch(config) == 'x86' else 'x64' | 182 target_platform = 'Win32' if self.GetArch(config) == 'x86' else 'x64' |
181 target_name = self.spec.get('product_prefix', '') + \ | 183 target_name = self.spec.get('product_prefix', '') + \ |
182 self.spec.get('product_name', self.spec['target_name']) | 184 self.spec.get('product_name', self.spec['target_name']) |
183 target_dir = base_to_build + '\\' if base_to_build else '' | 185 target_dir = base_to_build + '\\' if base_to_build else '' |
184 replacements = { | 186 replacements = { |
185 '$(OutDir)\\': target_dir, | 187 '$(OutDir)\\': target_dir, |
(...skipping 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
961 | 963 |
962 # To determine processor word size on Windows, in addition to checking | 964 # To determine processor word size on Windows, in addition to checking |
963 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current | 965 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current |
964 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which | 966 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which |
965 # contains the actual word size of the system when running thru WOW64). | 967 # contains the actual word size of the system when running thru WOW64). |
966 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or | 968 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or |
967 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): | 969 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): |
968 default_variables['MSVS_OS_BITS'] = 64 | 970 default_variables['MSVS_OS_BITS'] = 64 |
969 else: | 971 else: |
970 default_variables['MSVS_OS_BITS'] = 32 | 972 default_variables['MSVS_OS_BITS'] = 32 |
OLD | NEW |