MCPcopy Create free account
hub / github.com/nodejs/node / _GenerateRulesForMSVS

Function _GenerateRulesForMSVS

tools/gyp/pylib/gyp/generator/msvs.py:892–919  ·  view source on GitHub ↗

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
)

Source from the content-addressed store, hash-verified

890
891
892def _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
922def _AdjustSourcesForRules(rules, sources, excluded_sources, is_msbuild):

Callers 1

_GenerateMSVSProjectFunction · 0.85

Calls 5

intFunction · 0.85
_GenerateExternalRulesFunction · 0.85
_AdjustSourcesForRulesFunction · 0.85
getMethod · 0.65

Tested by

no test coverage detected