| 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 | 413 |
| 414 def GetLibFlags(self, config, gyp_to_build_path): | 414 def GetLibFlags(self, config, gyp_to_build_path): |
| 415 """Returns the flags that need to be added to lib commands.""" | 415 """Returns the flags that need to be added to lib commands.""" |
| 416 config = self._TargetConfig(config) | 416 config = self._TargetConfig(config) |
| 417 libflags = [] | 417 libflags = [] |
| 418 lib = self._GetWrapper(self, self.msvs_settings[config], | 418 lib = self._GetWrapper(self, self.msvs_settings[config], |
| 419 'VCLibrarianTool', append=libflags) | 419 'VCLibrarianTool', append=libflags) |
| 420 libflags.extend(self._GetAdditionalLibraryDirectories( | 420 libflags.extend(self._GetAdditionalLibraryDirectories( |
| 421 'VCLibrarianTool', config, gyp_to_build_path)) | 421 'VCLibrarianTool', config, gyp_to_build_path)) |
| 422 lib('LinkTimeCodeGeneration', map={'true': '/LTCG'}) | 422 lib('LinkTimeCodeGeneration', map={'true': '/LTCG'}) |
| 423 lib('TargetMachine', map={'1': 'X86', '17': 'X64'}, prefix='/MACHINE:') |
| 423 lib('AdditionalOptions') | 424 lib('AdditionalOptions') |
| 424 return libflags | 425 return libflags |
| 425 | 426 |
| 426 def GetDefFile(self, gyp_to_build_path): | 427 def GetDefFile(self, gyp_to_build_path): |
| 427 """Returns the .def file from sources, if any. Otherwise returns None.""" | 428 """Returns the .def file from sources, if any. Otherwise returns None.""" |
| 428 spec = self.spec | 429 spec = self.spec |
| 429 if spec['type'] in ('shared_library', 'loadable_module', 'executable'): | 430 if spec['type'] in ('shared_library', 'loadable_module', 'executable'): |
| 430 def_files = [s for s in spec.get('sources', []) if s.endswith('.def')] | 431 def_files = [s for s in spec.get('sources', []) if s.endswith('.def')] |
| 431 if len(def_files) == 1: | 432 if len(def_files) == 1: |
| 432 return gyp_to_build_path(def_files[0]) | 433 return gyp_to_build_path(def_files[0]) |
| (...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 871 | 872 |
| 872 # To determine processor word size on Windows, in addition to checking | 873 # To determine processor word size on Windows, in addition to checking |
| 873 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current | 874 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current |
| 874 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which | 875 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which |
| 875 # contains the actual word size of the system when running thru WOW64). | 876 # contains the actual word size of the system when running thru WOW64). |
| 876 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or | 877 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or |
| 877 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): | 878 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): |
| 878 default_variables['MSVS_OS_BITS'] = 64 | 879 default_variables['MSVS_OS_BITS'] = 64 |
| 879 else: | 880 else: |
| 880 default_variables['MSVS_OS_BITS'] = 32 | 881 default_variables['MSVS_OS_BITS'] = 32 |
| OLD | NEW |