| 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 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 459 if out: | 459 if out: |
| 460 ldflags.append('/OUT:' + out) | 460 ldflags.append('/OUT:' + out) |
| 461 pdb = self.GetPDBName(config, expand_special) | 461 pdb = self.GetPDBName(config, expand_special) |
| 462 if pdb: | 462 if pdb: |
| 463 ldflags.append('/PDB:' + pdb) | 463 ldflags.append('/PDB:' + pdb) |
| 464 map_file = self.GetMapFileName(config, expand_special) | 464 map_file = self.GetMapFileName(config, expand_special) |
| 465 ld('GenerateMapFile', map={'true': '/MAP:' + map_file if map_file | 465 ld('GenerateMapFile', map={'true': '/MAP:' + map_file if map_file |
| 466 else '/MAP'}) | 466 else '/MAP'}) |
| 467 ld('MapExports', map={'true': '/MAPINFO:EXPORTS'}) | 467 ld('MapExports', map={'true': '/MAPINFO:EXPORTS'}) |
| 468 ld('AdditionalOptions', prefix='') | 468 ld('AdditionalOptions', prefix='') |
| 469 ld('SubSystem', map={'1': 'CONSOLE', '2': 'WINDOWS'}, prefix='/SUBSYSTEM:') | 469 |
| 470 xp_version = '' |
| 471 # If we're targeting x86, make sure we're targeting XP. |
| 472 if self._Setting(('VCLinkerTool', 'TargetMachine'), |
| 473 config, default='1') == '1': |
| 474 xp_version = ',5.01' |
| 475 ld('SubSystem', |
| 476 map={'1': 'CONSOLE%s' % xp_version, |
| 477 '2': 'WINDOWS%s' % xp_version}, |
| 478 prefix='/SUBSYSTEM:') |
| 479 |
| 470 ld('TerminalServerAware', map={'1': ':NO', '2': ''}, prefix='/TSAWARE') | 480 ld('TerminalServerAware', map={'1': ':NO', '2': ''}, prefix='/TSAWARE') |
| 471 ld('LinkIncremental', map={'1': ':NO', '2': ''}, prefix='/INCREMENTAL') | 481 ld('LinkIncremental', map={'1': ':NO', '2': ''}, prefix='/INCREMENTAL') |
| 472 ld('FixedBaseAddress', map={'1': ':NO', '2': ''}, prefix='/FIXED') | 482 ld('FixedBaseAddress', map={'1': ':NO', '2': ''}, prefix='/FIXED') |
| 473 ld('RandomizedBaseAddress', | 483 ld('RandomizedBaseAddress', |
| 474 map={'1': ':NO', '2': ''}, prefix='/DYNAMICBASE') | 484 map={'1': ':NO', '2': ''}, prefix='/DYNAMICBASE') |
| 475 ld('DataExecutionPrevention', | 485 ld('DataExecutionPrevention', |
| 476 map={'1': ':NO', '2': ''}, prefix='/NXCOMPAT') | 486 map={'1': ':NO', '2': ''}, prefix='/NXCOMPAT') |
| 477 ld('OptimizeReferences', map={'1': 'NOREF', '2': 'REF'}, prefix='/OPT:') | 487 ld('OptimizeReferences', map={'1': 'NOREF', '2': 'REF'}, prefix='/OPT:') |
| 478 ld('EnableCOMDATFolding', map={'1': 'NOICF', '2': 'ICF'}, prefix='/OPT:') | 488 ld('EnableCOMDATFolding', map={'1': 'NOICF', '2': 'ICF'}, prefix='/OPT:') |
| 479 ld('LinkTimeCodeGeneration', map={'1': '/LTCG'}) | 489 ld('LinkTimeCodeGeneration', map={'1': '/LTCG'}) |
| (...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 861 | 871 |
| 862 # To determine processor word size on Windows, in addition to checking | 872 # To determine processor word size on Windows, in addition to checking |
| 863 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current | 873 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current |
| 864 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which | 874 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which |
| 865 # contains the actual word size of the system when running thru WOW64). | 875 # contains the actual word size of the system when running thru WOW64). |
| 866 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or | 876 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or |
| 867 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): | 877 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): |
| 868 default_variables['MSVS_OS_BITS'] = 64 | 878 default_variables['MSVS_OS_BITS'] = 64 |
| 869 else: | 879 else: |
| 870 default_variables['MSVS_OS_BITS'] = 32 | 880 default_variables['MSVS_OS_BITS'] = 32 |
| OLD | NEW |