| 384 | } |
| 385 | |
| 386 | void 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 | |
| 427 | std::string cmCustomCommandGenerator::GetDepfile() const |
| 428 | { |
no test coverage detected