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 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
469 | 469 |
470 def GetLibFlags(self, config, gyp_to_build_path): | 470 def GetLibFlags(self, config, gyp_to_build_path): |
471 """Returns the flags that need to be added to lib commands.""" | 471 """Returns the flags that need to be added to lib commands.""" |
472 config = self._TargetConfig(config) | 472 config = self._TargetConfig(config) |
473 libflags = [] | 473 libflags = [] |
474 lib = self._GetWrapper(self, self.msvs_settings[config], | 474 lib = self._GetWrapper(self, self.msvs_settings[config], |
475 'VCLibrarianTool', append=libflags) | 475 'VCLibrarianTool', append=libflags) |
476 libflags.extend(self._GetAdditionalLibraryDirectories( | 476 libflags.extend(self._GetAdditionalLibraryDirectories( |
477 'VCLibrarianTool', config, gyp_to_build_path)) | 477 'VCLibrarianTool', config, gyp_to_build_path)) |
478 lib('LinkTimeCodeGeneration', map={'true': '/LTCG'}) | 478 lib('LinkTimeCodeGeneration', map={'true': '/LTCG'}) |
479 lib('TargetMachine', map={'1': 'X86', '17': 'X64'}, prefix='/MACHINE:') | 479 lib('TargetMachine', map={'1': 'X86', '17': 'X64'}, |
scottmg
2014/09/23 16:25:09
please revert this file
| |
480 prefix='/MACHINE:') | |
480 lib('AdditionalOptions') | 481 lib('AdditionalOptions') |
481 return libflags | 482 return libflags |
482 | 483 |
483 def GetDefFile(self, gyp_to_build_path): | 484 def GetDefFile(self, gyp_to_build_path): |
484 """Returns the .def file from sources, if any. Otherwise returns None.""" | 485 """Returns the .def file from sources, if any. Otherwise returns None.""" |
485 spec = self.spec | 486 spec = self.spec |
486 if spec['type'] in ('shared_library', 'loadable_module', 'executable'): | 487 if spec['type'] in ('shared_library', 'loadable_module', 'executable'): |
487 def_files = [s for s in spec.get('sources', []) if s.endswith('.def')] | 488 def_files = [s for s in spec.get('sources', []) if s.endswith('.def')] |
488 if len(def_files) == 1: | 489 if len(def_files) == 1: |
489 return gyp_to_build_path(def_files[0]) | 490 return gyp_to_build_path(def_files[0]) |
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1016 | 1017 |
1017 # To determine processor word size on Windows, in addition to checking | 1018 # To determine processor word size on Windows, in addition to checking |
1018 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current | 1019 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current |
1019 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which | 1020 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which |
1020 # contains the actual word size of the system when running thru WOW64). | 1021 # contains the actual word size of the system when running thru WOW64). |
1021 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or | 1022 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or |
1022 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): | 1023 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): |
1023 default_variables['MSVS_OS_BITS'] = 64 | 1024 default_variables['MSVS_OS_BITS'] = 64 |
1024 else: | 1025 else: |
1025 default_variables['MSVS_OS_BITS'] = 32 | 1026 default_variables['MSVS_OS_BITS'] = 32 |
OLD | NEW |