| 887 | } |
| 888 | |
| 889 | std::string cmLocalNinjaGenerator::MakeCustomLauncher( |
| 890 | cmCustomCommandGenerator const& ccg) |
| 891 | { |
| 892 | cmValue property_value = this->Makefile->GetProperty("RULE_LAUNCH_CUSTOM"); |
| 893 | |
| 894 | if (!cmNonempty(property_value)) { |
| 895 | return std::string(); |
| 896 | } |
| 897 | |
| 898 | // Expand rule variables referenced in the given launcher command. |
| 899 | cmRulePlaceholderExpander::RuleVariables vars; |
| 900 | |
| 901 | std::string output; |
| 902 | std::vector<std::string> const& outputs = ccg.GetOutputs(); |
| 903 | for (size_t i = 0; i < outputs.size(); ++i) { |
| 904 | output = cmStrCat(output, |
| 905 | this->ConvertToOutputFormat( |
| 906 | ccg.GetWorkingDirectory().empty() |
| 907 | ? this->MaybeRelativeToCurBinDir(outputs[i]) |
| 908 | : outputs[i], |
| 909 | cmOutputConverter::SHELL)); |
| 910 | if (i != outputs.size() - 1) { |
| 911 | output = cmStrCat(output, ','); |
| 912 | } |
| 913 | } |
| 914 | vars.Output = output.c_str(); |
| 915 | vars.Role = ccg.GetCC().GetRole().c_str(); |
| 916 | vars.CMTargetName = ccg.GetCC().GetTarget().c_str(); |
| 917 | vars.Config = ccg.GetOutputConfig().c_str(); |
| 918 | |
| 919 | auto rulePlaceholderExpander = this->CreateRulePlaceholderExpander(); |
| 920 | |
| 921 | std::string launcher = *property_value; |
| 922 | rulePlaceholderExpander->ExpandRuleVariables(this, launcher, vars); |
| 923 | if (!launcher.empty()) { |
| 924 | launcher += " "; |
| 925 | } |
| 926 | |
| 927 | return launcher; |
| 928 | } |
| 929 | |
| 930 | void cmLocalNinjaGenerator::AdditionalCleanFiles(std::string const& config) |
| 931 | { |
no test coverage detected