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

Method MakeCustomLauncher

Source/cmLocalNinjaGenerator.cxx:889–928  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

887}
888
889std::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
930void cmLocalNinjaGenerator::AdditionalCleanFiles(std::string const& config)
931{

Callers 1

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

Tested by

no test coverage detected