Chromium Code Reviews| 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 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 338 generate_debug_info = self._Setting( | 338 generate_debug_info = self._Setting( |
| 339 ('VCLinkerTool', 'GenerateDebugInformation'), config) | 339 ('VCLinkerTool', 'GenerateDebugInformation'), config) |
| 340 if generate_debug_info: | 340 if generate_debug_info: |
| 341 if output_file: | 341 if output_file: |
| 342 return expand_special(self.ConvertVSMacros(output_file, config=config)) | 342 return expand_special(self.ConvertVSMacros(output_file, config=config)) |
| 343 else: | 343 else: |
| 344 return default | 344 return default |
| 345 else: | 345 else: |
| 346 return None | 346 return None |
| 347 | 347 |
| 348 def GetAsmflags(self, config): | |
| 349 """Returns the flags that need to be added to .asm compilations.""" | |
|
wtc
2014/04/09 03:41:08
".asm compilations" is not really accurate because
scottmg
2014/04/09 03:44:59
"...added to ml invocations."?
wtc
2014/04/10 02:42:00
Done.
| |
| 350 config = self._TargetConfig(config) | |
| 351 asmflags = [] | |
| 352 safeseh = self._Setting(('MASM', 'UseSafeExceptionHandlers'), config) | |
| 353 if safeseh == 'true': | |
| 354 asmflags.append('/safeseh') | |
| 355 return asmflags | |
| 356 | |
| 348 def GetCflags(self, config): | 357 def GetCflags(self, config): |
| 349 """Returns the flags that need to be added to .c and .cc compilations.""" | 358 """Returns the flags that need to be added to .c and .cc compilations.""" |
| 350 config = self._TargetConfig(config) | 359 config = self._TargetConfig(config) |
| 351 cflags = [] | 360 cflags = [] |
| 352 cflags.extend(['/wd' + w for w in self.msvs_disabled_warnings[config]]) | 361 cflags.extend(['/wd' + w for w in self.msvs_disabled_warnings[config]]) |
| 353 cl = self._GetWrapper(self, self.msvs_settings[config], | 362 cl = self._GetWrapper(self, self.msvs_settings[config], |
| 354 'VCCLCompilerTool', append=cflags) | 363 'VCCLCompilerTool', append=cflags) |
| 355 cl('Optimization', | 364 cl('Optimization', |
| 356 map={'0': 'd', '1': '1', '2': '2', '3': 'x'}, prefix='/O', default='2') | 365 map={'0': 'd', '1': '1', '2': '2', '3': 'x'}, prefix='/O', default='2') |
| 357 cl('InlineFunctionExpansion', prefix='/Ob') | 366 cl('InlineFunctionExpansion', prefix='/Ob') |
| (...skipping 601 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 959 | 968 |
| 960 # To determine processor word size on Windows, in addition to checking | 969 # To determine processor word size on Windows, in addition to checking |
| 961 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current | 970 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current |
| 962 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which | 971 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which |
| 963 # contains the actual word size of the system when running thru WOW64). | 972 # contains the actual word size of the system when running thru WOW64). |
| 964 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or | 973 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or |
| 965 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): | 974 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): |
| 966 default_variables['MSVS_OS_BITS'] = 64 | 975 default_variables['MSVS_OS_BITS'] = 64 |
| 967 else: | 976 else: |
| 968 default_variables['MSVS_OS_BITS'] = 32 | 977 default_variables['MSVS_OS_BITS'] = 32 |
| OLD | NEW |