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