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 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 cl('BufferSecurityCheck', map={'true': '/GS', 'false': '/GS-'}) | 372 cl('BufferSecurityCheck', map={'true': '/GS', 'false': '/GS-'}) |
373 cl('BasicRuntimeChecks', map={'1': 's', '2': 'u', '3': '1'}, prefix='/RTC') | 373 cl('BasicRuntimeChecks', map={'1': 's', '2': 'u', '3': '1'}, prefix='/RTC') |
374 cl('RuntimeLibrary', | 374 cl('RuntimeLibrary', |
375 map={'0': 'T', '1': 'Td', '2': 'D', '3': 'Dd'}, prefix='/M') | 375 map={'0': 'T', '1': 'Td', '2': 'D', '3': 'Dd'}, prefix='/M') |
376 cl('ExceptionHandling', map={'1': 'sc','2': 'a'}, prefix='/EH') | 376 cl('ExceptionHandling', map={'1': 'sc','2': 'a'}, prefix='/EH') |
377 cl('DefaultCharIsUnsigned', map={'true': '/J'}) | 377 cl('DefaultCharIsUnsigned', map={'true': '/J'}) |
378 cl('TreatWChar_tAsBuiltInType', | 378 cl('TreatWChar_tAsBuiltInType', |
379 map={'false': '-', 'true': ''}, prefix='/Zc:wchar_t') | 379 map={'false': '-', 'true': ''}, prefix='/Zc:wchar_t') |
380 cl('EnablePREfast', map={'true': '/analyze'}) | 380 cl('EnablePREfast', map={'true': '/analyze'}) |
381 cl('AdditionalOptions', prefix='') | 381 cl('AdditionalOptions', prefix='') |
| 382 cl('EnableEnhancedInstructionSet', |
| 383 map={'1': 'SSE', '2': 'SSE2', '3': 'AVX', '4': 'IA32'}, prefix='/arch:') |
382 cflags.extend(['/FI' + f for f in self._Setting( | 384 cflags.extend(['/FI' + f for f in self._Setting( |
383 ('VCCLCompilerTool', 'ForcedIncludeFiles'), config, default=[])]) | 385 ('VCCLCompilerTool', 'ForcedIncludeFiles'), config, default=[])]) |
384 if self.vs_version.short_name in ('2013', '2013e'): | 386 if self.vs_version.short_name in ('2013', '2013e'): |
385 # New flag required in 2013 to maintain previous PDB behavior. | 387 # New flag required in 2013 to maintain previous PDB behavior. |
386 cflags.append('/FS') | 388 cflags.append('/FS') |
387 # ninja handles parallelism by itself, don't have the compiler do it too. | 389 # ninja handles parallelism by itself, don't have the compiler do it too. |
388 cflags = filter(lambda x: not x.startswith('/MP'), cflags) | 390 cflags = filter(lambda x: not x.startswith('/MP'), cflags) |
389 return cflags | 391 return cflags |
390 | 392 |
391 def GetPrecompiledHeader(self, config, gyp_to_build_path): | 393 def GetPrecompiledHeader(self, config, gyp_to_build_path): |
(...skipping 571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 | 965 |
964 # To determine processor word size on Windows, in addition to checking | 966 # To determine processor word size on Windows, in addition to checking |
965 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current | 967 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current |
966 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which | 968 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which |
967 # contains the actual word size of the system when running thru WOW64). | 969 # contains the actual word size of the system when running thru WOW64). |
968 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or | 970 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or |
969 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): | 971 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): |
970 default_variables['MSVS_OS_BITS'] = 64 | 972 default_variables['MSVS_OS_BITS'] = 64 |
971 else: | 973 else: |
972 default_variables['MSVS_OS_BITS'] = 32 | 974 default_variables['MSVS_OS_BITS'] = 32 |
OLD | NEW |