MCPcopy Create free account
hub / github.com/Kitware/CMake / MakeCustomLauncher

Method MakeCustomLauncher

Source/cmFastbuildTargetGenerator.cxx:689–733  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

687}
688
689std::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
735std::string cmFastbuildTargetGenerator::GetTargetName() const
736{

Callers 1

GenerateCommandsMethod · 0.95

Calls 13

cmNonemptyFunction · 0.85
c_strMethod · 0.80
GetRoleMethod · 0.80
ExpandRuleVariablesMethod · 0.80
cmStrCatFunction · 0.70
GetPropertyMethod · 0.45
sizeMethod · 0.45
ConvertToOutputFormatMethod · 0.45
emptyMethod · 0.45
GetWorkingDirectoryMethod · 0.45
GetTargetMethod · 0.45

Tested by

no test coverage detected