| 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 copy | 5 import copy |
| 6 import gyp | 6 import gyp |
| 7 import gyp.common | 7 import gyp.common |
| 8 import gyp.msvs_emulation | 8 import gyp.msvs_emulation |
| 9 import gyp.MSVSVersion | 9 import gyp.MSVSVersion |
| 10 import gyp.system_test | 10 import gyp.system_test |
| (...skipping 28 matching lines...) Expand all Loading... |
| 39 # Special variables that may be used by gyp 'rule' targets. | 39 # Special variables that may be used by gyp 'rule' targets. |
| 40 # We generate definitions for these variables on the fly when processing a | 40 # We generate definitions for these variables on the fly when processing a |
| 41 # rule. | 41 # rule. |
| 42 'RULE_INPUT_ROOT': '${root}', | 42 'RULE_INPUT_ROOT': '${root}', |
| 43 'RULE_INPUT_DIRNAME': '${dirname}', | 43 'RULE_INPUT_DIRNAME': '${dirname}', |
| 44 'RULE_INPUT_PATH': '${source}', | 44 'RULE_INPUT_PATH': '${source}', |
| 45 'RULE_INPUT_EXT': '${ext}', | 45 'RULE_INPUT_EXT': '${ext}', |
| 46 'RULE_INPUT_NAME': '${name}', | 46 'RULE_INPUT_NAME': '${name}', |
| 47 } | 47 } |
| 48 | 48 |
| 49 # Placates pylint. |
| 50 generator_additional_non_configuration_keys = [] |
| 51 generator_additional_path_sections = [] |
| 52 generator_extra_sources_for_rules = [] |
| 53 |
| 49 # TODO: figure out how to not build extra host objects in the non-cross-compile | 54 # TODO: figure out how to not build extra host objects in the non-cross-compile |
| 50 # case when this is enabled, and enable unconditionally. | 55 # case when this is enabled, and enable unconditionally. |
| 51 generator_supports_multiple_toolsets = ( | 56 generator_supports_multiple_toolsets = ( |
| 52 os.environ.get('AR_target') or os.environ.get('CC_target') or | 57 os.environ.get('AR_target') or os.environ.get('CC_target') or |
| 53 os.environ.get('CXX_target')) | 58 os.environ.get('CXX_target')) |
| 54 | 59 |
| 55 | 60 |
| 56 def StripPrefix(arg, prefix): | 61 def StripPrefix(arg, prefix): |
| 57 if arg.startswith(prefix): | 62 if arg.startswith(prefix): |
| 58 return arg[len(prefix):] | 63 return arg[len(prefix):] |
| (...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1013 if prefix == 'lib': | 1018 if prefix == 'lib': |
| 1014 # Snip out an extra 'lib' from libs if appropriate. | 1019 # Snip out an extra 'lib' from libs if appropriate. |
| 1015 target = StripPrefix(target, 'lib') | 1020 target = StripPrefix(target, 'lib') |
| 1016 | 1021 |
| 1017 if type in ('static_library', 'loadable_module', 'shared_library', | 1022 if type in ('static_library', 'loadable_module', 'shared_library', |
| 1018 'executable'): | 1023 'executable'): |
| 1019 return '%s%s%s' % (prefix, target, extension) | 1024 return '%s%s%s' % (prefix, target, extension) |
| 1020 elif type == 'none': | 1025 elif type == 'none': |
| 1021 return '%s.stamp' % target | 1026 return '%s.stamp' % target |
| 1022 else: | 1027 else: |
| 1023 raise 'Unhandled output type', type | 1028 raise Exception('Unhandled output type %s' % type) |
| 1024 | 1029 |
| 1025 def ComputeOutput(self, spec, type=None): | 1030 def ComputeOutput(self, spec, type=None): |
| 1026 """Compute the path for the final output of the spec.""" | 1031 """Compute the path for the final output of the spec.""" |
| 1027 assert not self.is_mac_bundle or type | 1032 assert not self.is_mac_bundle or type |
| 1028 | 1033 |
| 1029 if not type: | 1034 if not type: |
| 1030 type = spec['type'] | 1035 type = spec['type'] |
| 1031 | 1036 |
| 1032 if self.flavor == 'win': | 1037 if self.flavor == 'win': |
| 1033 override = self.msvs_settings.GetOutputName(self.config_name, | 1038 override = self.msvs_settings.GetOutputName(self.config_name, |
| (...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1495 | 1500 |
| 1496 user_config = params.get('generator_flags', {}).get('config', None) | 1501 user_config = params.get('generator_flags', {}).get('config', None) |
| 1497 if user_config: | 1502 if user_config: |
| 1498 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1503 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 1499 user_config) | 1504 user_config) |
| 1500 else: | 1505 else: |
| 1501 config_names = target_dicts[target_list[0]]['configurations'].keys() | 1506 config_names = target_dicts[target_list[0]]['configurations'].keys() |
| 1502 for config_name in config_names: | 1507 for config_name in config_names: |
| 1503 GenerateOutputForConfig(target_list, target_dicts, data, params, | 1508 GenerateOutputForConfig(target_list, target_dicts, data, params, |
| 1504 config_name) | 1509 config_name) |
| OLD | NEW |