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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
471 | 471 |
472 def GetLibFlags(self, config, gyp_to_build_path): | 472 def GetLibFlags(self, config, gyp_to_build_path): |
473 """Returns the flags that need to be added to lib commands.""" | 473 """Returns the flags that need to be added to lib commands.""" |
474 config = self._TargetConfig(config) | 474 config = self._TargetConfig(config) |
475 libflags = [] | 475 libflags = [] |
476 lib = self._GetWrapper(self, self.msvs_settings[config], | 476 lib = self._GetWrapper(self, self.msvs_settings[config], |
477 'VCLibrarianTool', append=libflags) | 477 'VCLibrarianTool', append=libflags) |
478 libflags.extend(self._GetAdditionalLibraryDirectories( | 478 libflags.extend(self._GetAdditionalLibraryDirectories( |
479 'VCLibrarianTool', config, gyp_to_build_path)) | 479 'VCLibrarianTool', config, gyp_to_build_path)) |
480 lib('LinkTimeCodeGeneration', map={'true': '/LTCG'}) | 480 lib('LinkTimeCodeGeneration', map={'true': '/LTCG'}) |
481 lib('TargetMachine', map={'1': 'X86', '17': 'X64'}, prefix='/MACHINE:') | 481 lib('TargetMachine', map={'1': 'X86', '17': 'X64', '3': 'ARM'}, |
482 prefix='/MACHINE:') | |
scottmg
2014/09/25 16:48:32
nit; align to (
| |
482 lib('AdditionalOptions') | 483 lib('AdditionalOptions') |
483 return libflags | 484 return libflags |
484 | 485 |
485 def GetDefFile(self, gyp_to_build_path): | 486 def GetDefFile(self, gyp_to_build_path): |
486 """Returns the .def file from sources, if any. Otherwise returns None.""" | 487 """Returns the .def file from sources, if any. Otherwise returns None.""" |
487 spec = self.spec | 488 spec = self.spec |
488 if spec['type'] in ('shared_library', 'loadable_module', 'executable'): | 489 if spec['type'] in ('shared_library', 'loadable_module', 'executable'): |
489 def_files = [s for s in spec.get('sources', []) if s.endswith('.def')] | 490 def_files = [s for s in spec.get('sources', []) if s.endswith('.def')] |
490 if len(def_files) == 1: | 491 if len(def_files) == 1: |
491 return gyp_to_build_path(def_files[0]) | 492 return gyp_to_build_path(def_files[0]) |
(...skipping 22 matching lines...) Expand all Loading... | |
514 def GetLdflags(self, config, gyp_to_build_path, expand_special, | 515 def GetLdflags(self, config, gyp_to_build_path, expand_special, |
515 manifest_base_name, output_name, is_executable, build_dir): | 516 manifest_base_name, output_name, is_executable, build_dir): |
516 """Returns the flags that need to be added to link commands, and the | 517 """Returns the flags that need to be added to link commands, and the |
517 manifest files.""" | 518 manifest files.""" |
518 config = self._TargetConfig(config) | 519 config = self._TargetConfig(config) |
519 ldflags = [] | 520 ldflags = [] |
520 ld = self._GetWrapper(self, self.msvs_settings[config], | 521 ld = self._GetWrapper(self, self.msvs_settings[config], |
521 'VCLinkerTool', append=ldflags) | 522 'VCLinkerTool', append=ldflags) |
522 self._GetDefFileAsLdflags(ldflags, gyp_to_build_path) | 523 self._GetDefFileAsLdflags(ldflags, gyp_to_build_path) |
523 ld('GenerateDebugInformation', map={'true': '/DEBUG'}) | 524 ld('GenerateDebugInformation', map={'true': '/DEBUG'}) |
524 ld('TargetMachine', map={'1': 'X86', '17': 'X64'}, prefix='/MACHINE:') | 525 ld('TargetMachine', map={'1': 'X86', '17': 'X64', '3': 'ARM'}, |
526 prefix='/MACHINE:') | |
525 ldflags.extend(self._GetAdditionalLibraryDirectories( | 527 ldflags.extend(self._GetAdditionalLibraryDirectories( |
526 'VCLinkerTool', config, gyp_to_build_path)) | 528 'VCLinkerTool', config, gyp_to_build_path)) |
527 ld('DelayLoadDLLs', prefix='/DELAYLOAD:') | 529 ld('DelayLoadDLLs', prefix='/DELAYLOAD:') |
528 ld('TreatLinkerWarningAsErrors', prefix='/WX', | 530 ld('TreatLinkerWarningAsErrors', prefix='/WX', |
529 map={'true': '', 'false': ':NO'}) | 531 map={'true': '', 'false': ':NO'}) |
530 out = self.GetOutputName(config, expand_special) | 532 out = self.GetOutputName(config, expand_special) |
531 if out: | 533 if out: |
532 ldflags.append('/OUT:' + out) | 534 ldflags.append('/OUT:' + out) |
533 pdb = self.GetPDBName(config, expand_special, output_name + '.pdb') | 535 pdb = self.GetPDBName(config, expand_special, output_name + '.pdb') |
534 if pdb: | 536 if pdb: |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1018 | 1020 |
1019 # To determine processor word size on Windows, in addition to checking | 1021 # To determine processor word size on Windows, in addition to checking |
1020 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current | 1022 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current |
1021 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which | 1023 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which |
1022 # contains the actual word size of the system when running thru WOW64). | 1024 # contains the actual word size of the system when running thru WOW64). |
1023 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or | 1025 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or |
1024 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): | 1026 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): |
1025 default_variables['MSVS_OS_BITS'] = 64 | 1027 default_variables['MSVS_OS_BITS'] = 64 |
1026 else: | 1028 else: |
1027 default_variables['MSVS_OS_BITS'] = 32 | 1029 default_variables['MSVS_OS_BITS'] = 32 |
OLD | NEW |