(
spec,
sources,
exclusions,
grouped_sources,
rule_dependencies,
extension_to_rule_name,
sources_handled_by_action,
list_excluded,
)
| 3537 | |
| 3538 | |
| 3539 | def _AddSources2( |
| 3540 | spec, |
| 3541 | sources, |
| 3542 | exclusions, |
| 3543 | grouped_sources, |
| 3544 | rule_dependencies, |
| 3545 | extension_to_rule_name, |
| 3546 | sources_handled_by_action, |
| 3547 | list_excluded, |
| 3548 | ): |
| 3549 | extensions_excluded_from_precompile = [] |
| 3550 | for source in sources: |
| 3551 | if isinstance(source, MSVSProject.Filter): |
| 3552 | _AddSources2( |
| 3553 | spec, |
| 3554 | source.contents, |
| 3555 | exclusions, |
| 3556 | grouped_sources, |
| 3557 | rule_dependencies, |
| 3558 | extension_to_rule_name, |
| 3559 | sources_handled_by_action, |
| 3560 | list_excluded, |
| 3561 | ) |
| 3562 | elif source not in sources_handled_by_action: |
| 3563 | detail = [] |
| 3564 | excluded_configurations = exclusions.get(source, []) |
| 3565 | if len(excluded_configurations) == len(spec["configurations"]): |
| 3566 | detail.append(["ExcludedFromBuild", "true"]) |
| 3567 | else: |
| 3568 | for config_name, configuration in sorted(excluded_configurations): |
| 3569 | condition = _GetConfigurationCondition(config_name, configuration) |
| 3570 | detail.append( |
| 3571 | ["ExcludedFromBuild", {"Condition": condition}, "true"] |
| 3572 | ) |
| 3573 | # Add precompile if needed |
| 3574 | for config_name, configuration in spec["configurations"].items(): |
| 3575 | precompiled_source = configuration.get("msvs_precompiled_source", "") |
| 3576 | if precompiled_source != "": |
| 3577 | precompiled_source = _FixPath(precompiled_source) |
| 3578 | if not extensions_excluded_from_precompile: |
| 3579 | # If the precompiled header is generated by a C source, |
| 3580 | # we must not try to use it for C++ sources, |
| 3581 | # and vice versa. |
| 3582 | _basename, extension = os.path.splitext(precompiled_source) |
| 3583 | if extension == ".c": |
| 3584 | extensions_excluded_from_precompile = [ |
| 3585 | ".cc", |
| 3586 | ".cpp", |
| 3587 | ".cxx", |
| 3588 | ] |
| 3589 | else: |
| 3590 | extensions_excluded_from_precompile = [".c"] |
| 3591 | |
| 3592 | if precompiled_source == source: |
| 3593 | condition = _GetConfigurationCondition( |
| 3594 | config_name, configuration, spec |
| 3595 | ) |
| 3596 | detail.append( |
no test coverage detected