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 import collections | 5 import collections |
6 import os | 6 import os |
7 import gyp | 7 import gyp |
8 import gyp.common | 8 import gyp.common |
9 import gyp.msvs_emulation | 9 import gyp.msvs_emulation |
10 import json | 10 import json |
(...skipping 27 matching lines...) Expand all Loading... |
38 flavor = gyp.common.GetFlavor(params) | 38 flavor = gyp.common.GetFlavor(params) |
39 if flavor =='win': | 39 if flavor =='win': |
40 # Copy additional generator configuration data from VS, which is shared | 40 # Copy additional generator configuration data from VS, which is shared |
41 # by the Windows Ninja generator. | 41 # by the Windows Ninja generator. |
42 import gyp.generator.msvs as msvs_generator | 42 import gyp.generator.msvs as msvs_generator |
43 generator_additional_non_configuration_keys = getattr(msvs_generator, | 43 generator_additional_non_configuration_keys = getattr(msvs_generator, |
44 'generator_additional_non_configuration_keys', []) | 44 'generator_additional_non_configuration_keys', []) |
45 generator_additional_path_sections = getattr(msvs_generator, | 45 generator_additional_path_sections = getattr(msvs_generator, |
46 'generator_additional_path_sections', []) | 46 'generator_additional_path_sections', []) |
47 | 47 |
48 # Set a variable so conditions can be based on msvs_version. | 48 gyp.msvs_emulation.CalculateCommonVariables(default_variables, params) |
49 msvs_version = gyp.msvs_emulation.GetVSVersion(generator_flags) | |
50 default_variables['MSVS_VERSION'] = msvs_version.ShortName() | |
51 | |
52 # To determine processor word size on Windows, in addition to checking | |
53 # PROCESSOR_ARCHITECTURE (which reflects the word size of the current | |
54 # process), it is also necessary to check PROCESSOR_ARCHITEW6432 (which | |
55 # contains the actual word size of the system when running thru WOW64). | |
56 if ('64' in os.environ.get('PROCESSOR_ARCHITECTURE', '') or | |
57 '64' in os.environ.get('PROCESSOR_ARCHITEW6432', '')): | |
58 default_variables['MSVS_OS_BITS'] = 64 | |
59 else: | |
60 default_variables['MSVS_OS_BITS'] = 32 | |
61 | 49 |
62 | 50 |
63 def CalculateGeneratorInputInfo(params): | 51 def CalculateGeneratorInputInfo(params): |
64 """Calculate the generator specific info that gets fed to input (called by | 52 """Calculate the generator specific info that gets fed to input (called by |
65 gyp).""" | 53 gyp).""" |
66 generator_flags = params.get('generator_flags', {}) | 54 generator_flags = params.get('generator_flags', {}) |
67 if generator_flags.get('adjust_static_libraries', False): | 55 if generator_flags.get('adjust_static_libraries', False): |
68 global generator_wants_static_library_dependencies_adjusted | 56 global generator_wants_static_library_dependencies_adjusted |
69 generator_wants_static_library_dependencies_adjusted = True | 57 generator_wants_static_library_dependencies_adjusted = True |
70 | 58 |
(...skipping 13 matching lines...) Expand all Loading... |
84 | 72 |
85 for dep in target_dicts[target].get('dependencies', []): | 73 for dep in target_dicts[target].get('dependencies', []): |
86 edges[target].append(dep) | 74 edges[target].append(dep) |
87 targets_to_visit.append(dep) | 75 targets_to_visit.append(dep) |
88 | 76 |
89 filename = 'dump.json' | 77 filename = 'dump.json' |
90 f = open(filename, 'w') | 78 f = open(filename, 'w') |
91 json.dump(edges, f) | 79 json.dump(edges, f) |
92 f.close() | 80 f.close() |
93 print 'Wrote json to %s.' % filename | 81 print 'Wrote json to %s.' % filename |
OLD | NEW |