OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 import copy | 3 import copy |
4 import gyp.common | 4 import gyp.common |
5 import optparse | 5 import optparse |
6 import os.path | 6 import os.path |
7 import re | 7 import re |
8 import shlex | 8 import shlex |
9 import subprocess | 9 import subprocess |
10 | 10 |
11 | 11 |
12 # A list of types that are treated as linkable. | 12 # A list of types that are treated as linkable. |
13 linkable_types = ['application', 'executable', 'shared_library'] | 13 linkable_types = ['executable', 'shared_library'] |
14 | 14 |
15 # A list of sections that contain links to other targets. | 15 # A list of sections that contain links to other targets. |
16 dependency_sections = ['dependencies', 'export_dependent_settings'] | 16 dependency_sections = ['dependencies', 'export_dependent_settings'] |
17 | 17 |
18 # A list of sections that contain pathnames. You should probably call | 18 # A list of sections that contain pathnames. You should probably call |
19 # IsPathSection instead, which has other checks. | 19 # IsPathSection instead, which has other checks. |
20 path_sections = [ | 20 path_sections = [ |
21 'destination', | 21 'destination', |
22 'files', | 22 'files', |
23 'include_dirs', | 23 'include_dirs', |
(...skipping 816 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
840 if initial and not is_linkable: | 840 if initial and not is_linkable: |
841 # If this is the first target being examined and it's not linkable, | 841 # If this is the first target being examined and it's not linkable, |
842 # return an empty list of link dependencies, because the link | 842 # return an empty list of link dependencies, because the link |
843 # dependencies are intended to apply to the target itself (initial is | 843 # dependencies are intended to apply to the target itself (initial is |
844 # True) and this target won't be linked. | 844 # True) and this target won't be linked. |
845 return dependencies | 845 return dependencies |
846 | 846 |
847 # Executables are already fully and finally linked. Nothing else can be | 847 # Executables are already fully and finally linked. Nothing else can be |
848 # a link dependency of an executable, there can only be dependencies in | 848 # a link dependency of an executable, there can only be dependencies in |
849 # the sense that a dependent target might run an executable. | 849 # the sense that a dependent target might run an executable. |
850 if not initial and target_type in ['application', 'executable']: | 850 if not initial and target_type == 'executable': |
851 return dependencies | 851 return dependencies |
852 | 852 |
853 # The target is linkable, add it to the list of link dependencies. | 853 # The target is linkable, add it to the list of link dependencies. |
854 if self.ref not in dependencies: | 854 if self.ref not in dependencies: |
855 if target_type != 'none': | 855 if target_type != 'none': |
856 # Special case: "none" type targets don't produce any linkable products | 856 # Special case: "none" type targets don't produce any linkable products |
857 # and shouldn't be exposed as link dependencies, although dependencies | 857 # and shouldn't be exposed as link dependencies, although dependencies |
858 # of "none" type targets may still be link dependencies. | 858 # of "none" type targets may still be link dependencies. |
859 dependencies.append(self.ref) | 859 dependencies.append(self.ref) |
860 if initial or not is_linkable: | 860 if initial or not is_linkable: |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 # non_configuraiton_keys is a list of key names that belong in the target | 1159 # non_configuraiton_keys is a list of key names that belong in the target |
1160 # itself and should not be propagated into its configurations. | 1160 # itself and should not be propagated into its configurations. |
1161 non_configuration_keys = [ | 1161 non_configuration_keys = [ |
1162 # Sections that must exist inside targets and not configurations. | 1162 # Sections that must exist inside targets and not configurations. |
1163 'actions', | 1163 'actions', |
1164 'configurations', | 1164 'configurations', |
1165 'copies', | 1165 'copies', |
1166 'default_configuration', | 1166 'default_configuration', |
1167 'dependencies', | 1167 'dependencies', |
1168 'libraries', | 1168 'libraries', |
| 1169 'mac_bundle', |
1169 'mac_bundle_resources', | 1170 'mac_bundle_resources', |
1170 'postbuilds', | 1171 'postbuilds', |
1171 'product_dir', | 1172 'product_dir', |
1172 'product_name', | 1173 'product_name', |
1173 'rules', | 1174 'rules', |
1174 'sources', | 1175 'sources', |
1175 'suppress_wildcard', | 1176 'suppress_wildcard', |
1176 'target_name', | 1177 'target_name', |
1177 'test', | 1178 'test', |
1178 'type', | 1179 'type', |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1523 # needed. Not all generators will need to use the rule_sources lists, but | 1524 # needed. Not all generators will need to use the rule_sources lists, but |
1524 # some may, and it seems best to build the list in a common spot. | 1525 # some may, and it seems best to build the list in a common spot. |
1525 for target in flat_list: | 1526 for target in flat_list: |
1526 target_dict = targets[target] | 1527 target_dict = targets[target] |
1527 ValidateRulesInTarget(target, target_dict) | 1528 ValidateRulesInTarget(target, target_dict) |
1528 | 1529 |
1529 # TODO(mark): Return |data| for now because the generator needs a list of | 1530 # TODO(mark): Return |data| for now because the generator needs a list of |
1530 # build files that came in. In the future, maybe it should just accept | 1531 # build files that came in. In the future, maybe it should just accept |
1531 # a list, and not the whole data dict. | 1532 # a list, and not the whole data dict. |
1532 return [flat_list, targets, data] | 1533 return [flat_list, targets, data] |
OLD | NEW |