| 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 """GYP backend that generates Eclipse CDT settings files. | 5 """GYP backend that generates Eclipse CDT settings files. |
| 6 | 6 |
| 7 This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML | 7 This backend DOES NOT generate Eclipse CDT projects. Instead, it generates XML |
| 8 files that can be imported into an Eclipse CDT project. The XML file contains a | 8 files that can be imported into an Eclipse CDT project. The XML file contains a |
| 9 list of include paths and symbols (i.e. defines). | 9 list of include paths and symbols (i.e. defines). |
| 10 | 10 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 57 default_variables.setdefault('OS', flavor) | 57 default_variables.setdefault('OS', flavor) |
| 58 if flavor == 'win': | 58 if flavor == 'win': |
| 59 # Copy additional generator configuration data from VS, which is shared | 59 # Copy additional generator configuration data from VS, which is shared |
| 60 # by the Eclipse generator. | 60 # by the Eclipse generator. |
| 61 import gyp.generator.msvs as msvs_generator | 61 import gyp.generator.msvs as msvs_generator |
| 62 generator_additional_non_configuration_keys = getattr(msvs_generator, | 62 generator_additional_non_configuration_keys = getattr(msvs_generator, |
| 63 'generator_additional_non_configuration_keys', []) | 63 'generator_additional_non_configuration_keys', []) |
| 64 generator_additional_path_sections = getattr(msvs_generator, | 64 generator_additional_path_sections = getattr(msvs_generator, |
| 65 'generator_additional_path_sections', []) | 65 'generator_additional_path_sections', []) |
| 66 | 66 |
| 67 # Set a variable so conditions can be based on msvs_version. | 67 gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) |
| 68 msvs_version = gyp.msvs_emulation.GetVSVersion(generator_flags) | |
| 69 default_variables['MSVS_VERSION'] = msvs_version.ShortName() | |
| 70 | |
| 71 # To determine processor word size on Windows, in addition to checking | |
| 72 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current | |
| 73 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which | |
| 74 # contains the actual word size of the system when running thru WOW64). | |
| 75 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or | |
| 76 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): | |
| 77 default_variables['MSVS_OS_BITS'] = 64 | |
| 78 else: | |
| 79 default_variables['MSVS_OS_BITS'] = 32 | |
| 80 | 68 |
| 81 | 69 |
| 82 def CalculateGeneratorInputInfo(params): | 70 def CalculateGeneratorInputInfo(params): |
| 83 """Calculate the generator specific info that gets fed to input (called by | 71 """Calculate the generator specific info that gets fed to input (called by |
| 84 gyp).""" | 72 gyp).""" |
| 85 generator_flags = params.get('generator_flags', {}) | 73 generator_flags = params.get('generator_flags', {}) |
| 86 if generator_flags.get('adjust_static_libraries', False): | 74 if generator_flags.get('adjust_static_libraries', False): |
| 87 global generator_wants_static_library_dependencies_adjusted | 75 global generator_wants_static_library_dependencies_adjusted |
| 88 generator_wants_static_library_dependencies_adjusted = True | 76 generator_wants_static_library_dependencies_adjusted = True |
| 89 | 77 |
| (...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 311 user_config = params.get('generator_flags', {}).get('config', None) | 299 user_config = params.get('generator_flags', {}).get('config', None) |
| 312 if user_config: | 300 if user_config: |
| 313 GenerateOutputForConfig(target_list, target_dicts, data, params, | 301 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 314 user_config) | 302 user_config) |
| 315 else: | 303 else: |
| 316 config_names = target_dicts[target_list[0]]['configurations'].keys() | 304 config_names = target_dicts[target_list[0]]['configurations'].keys() |
| 317 for config_name in config_names: | 305 for config_name in config_names: |
| 318 GenerateOutputForConfig(target_list, target_dicts, data, params, | 306 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 319 config_name) | 307 config_name) |
| 320 | 308 |
| OLD | NEW |