Generate all the rules for a particular project. Arguments: p: the project output_dir: directory to emit rules to options: global options passed to the generator spec: the specification for this project sources: the set of all known source files in this project
(
p, output_dir, options, spec, sources, excluded_sources, actions_to_add
)
| 890 | |
| 891 | |
| 892 | def _GenerateRulesForMSVS( |
| 893 | p, output_dir, options, spec, sources, excluded_sources, actions_to_add |
| 894 | ): |
| 895 | """Generate all the rules for a particular project. |
| 896 | |
| 897 | Arguments: |
| 898 | p: the project |
| 899 | output_dir: directory to emit rules to |
| 900 | options: global options passed to the generator |
| 901 | spec: the specification for this project |
| 902 | sources: the set of all known source files in this project |
| 903 | excluded_sources: the set of sources excluded from normal processing |
| 904 | actions_to_add: deferred list of actions to add in |
| 905 | """ |
| 906 | rules = spec.get("rules", []) |
| 907 | rules_native = [r for r in rules if not int(r.get("msvs_external_rule", 0))] |
| 908 | rules_external = [r for r in rules if int(r.get("msvs_external_rule", 0))] |
| 909 | |
| 910 | # Handle rules that use a native rules file. |
| 911 | if rules_native: |
| 912 | _GenerateNativeRulesForMSVS(p, rules_native, output_dir, spec, options) |
| 913 | |
| 914 | # Handle external rules (non-native rules). |
| 915 | if rules_external: |
| 916 | _GenerateExternalRules( |
| 917 | rules_external, output_dir, spec, sources, options, actions_to_add |
| 918 | ) |
| 919 | _AdjustSourcesForRules(rules, sources, excluded_sources, False) |
| 920 | |
| 921 | |
| 922 | def _AdjustSourcesForRules(rules, sources, excluded_sources, is_msbuild): |
no test coverage detected