| 687 | } |
| 688 | |
| 689 | std::string cmFastbuildTargetGenerator::MakeCustomLauncher( |
| 690 | cmCustomCommandGenerator const& ccg) |
| 691 | { |
| 692 | // Copied from cmLocalNinjaGenerator::MakeCustomLauncher. |
| 693 | cmValue property_value = this->Makefile->GetProperty("RULE_LAUNCH_CUSTOM"); |
| 694 | |
| 695 | if (!cmNonempty(property_value)) { |
| 696 | return std::string(); |
| 697 | } |
| 698 | |
| 699 | // Expand rule variables referenced in the given launcher command. |
| 700 | cmRulePlaceholderExpander::RuleVariables vars; |
| 701 | |
| 702 | std::string output; |
| 703 | std::vector<std::string> const& outputs = ccg.GetOutputs(); |
| 704 | for (size_t i = 0; i < outputs.size(); ++i) { |
| 705 | output = |
| 706 | cmStrCat(output, |
| 707 | this->LocalGenerator->ConvertToOutputFormat( |
| 708 | ccg.GetWorkingDirectory().empty() |
| 709 | ? this->LocalGenerator->MaybeRelativeToCurBinDir(outputs[i]) |
| 710 | : outputs[i], |
| 711 | cmOutputConverter::SHELL)); |
| 712 | if (i != outputs.size() - 1) { |
| 713 | output = cmStrCat(output, ','); |
| 714 | } |
| 715 | } |
| 716 | vars.Output = output.c_str(); |
| 717 | vars.Role = ccg.GetCC().GetRole().c_str(); |
| 718 | vars.CMTargetName = ccg.GetCC().GetTarget().c_str(); |
| 719 | vars.Config = ccg.GetOutputConfig().c_str(); |
| 720 | |
| 721 | auto rulePlaceholderExpander = |
| 722 | this->LocalGenerator->CreateRulePlaceholderExpander(); |
| 723 | |
| 724 | std::string launcher = *property_value; |
| 725 | rulePlaceholderExpander->ExpandRuleVariables(this->LocalGenerator, launcher, |
| 726 | vars); |
| 727 | if (!launcher.empty()) { |
| 728 | launcher += " "; |
| 729 | } |
| 730 | |
| 731 | LogMessage("CC Launcher: " + launcher); |
| 732 | return launcher; |
| 733 | } |
| 734 | |
| 735 | std::string cmFastbuildTargetGenerator::GetTargetName() const |
| 736 | { |
no test coverage detected