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

Method AppendArguments

Source/cmCustomCommandGenerator.cxx:386–425  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

384}
385
386void cmCustomCommandGenerator::AppendArguments(unsigned int c,
387 std::string& cmd) const
388{
389 unsigned int offset = 1;
390 std::vector<std::string> emulator = this->GetCrossCompilingEmulator(c);
391 if (!emulator.empty()) {
392 for (unsigned j = 1; j < emulator.size(); ++j) {
393 cmd += " ";
394 if (this->OldStyle) {
395 cmd += escapeForShellOldStyle(emulator[j]);
396 } else {
397 cmd +=
398 this->LG->EscapeForShell(emulator[j], this->MakeVars, false, false,
399 this->MakeVars && this->LG->IsNinjaMulti());
400 }
401 }
402
403 offset = 0;
404 }
405
406 cmCustomCommandLine const& commandLine = this->CommandLines[c];
407 for (unsigned int j = offset; j < commandLine.size(); ++j) {
408 std::string arg;
409 if (char const* location = j == 0 ? this->GetArgv0Location(c) : nullptr) {
410 // GetCommand returned the emulator instead of the argv0 location,
411 // so transform the latter now.
412 arg = location;
413 } else {
414 arg = commandLine[j];
415 }
416 cmd += " ";
417 if (this->OldStyle) {
418 cmd += escapeForShellOldStyle(arg);
419 } else {
420 cmd +=
421 this->LG->EscapeForShell(arg, this->MakeVars, false, false,
422 this->MakeVars && this->LG->IsNinjaMulti());
423 }
424 }
425}
426
427std::string cmCustomCommandGenerator::GetDepfile() const
428{

Callers 7

ConstructScriptMethod · 0.80
ConstructScriptMethod · 0.80
AppendCustomCommandMethod · 0.80
GenerateCommandsMethod · 0.80

Calls 7

GetArgv0LocationMethod · 0.95
escapeForShellOldStyleFunction · 0.85
EscapeForShellMethod · 0.80
IsNinjaMultiMethod · 0.80
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected