Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(377)

Side by Side Diff: pylib/gyp/generator/eclipse.py

Issue 25757002: Refactor calculation of variables, common to many generators. (Closed) Base URL: http://gyp.googlecode.com/svn/trunk
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « pylib/gyp/generator/dump_dependency_json.py ('k') | pylib/gyp/generator/ninja.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « pylib/gyp/generator/dump_dependency_json.py ('k') | pylib/gyp/generator/ninja.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698