| 367 | } |
| 368 | |
| 369 | void cmGhsMultiTargetGenerator::WriteBuildEventsHelper( |
| 370 | std::ostream& fout, std::vector<cmCustomCommand> const& ccv, |
| 371 | std::string const& name, std::string const& cmd) |
| 372 | { |
| 373 | int cmdcount = 0; |
| 374 | #ifdef _WIN32 |
| 375 | std::string fext = ".bat"; |
| 376 | std::string shell; |
| 377 | #else |
| 378 | std::string fext = ".sh"; |
| 379 | std::string shell = "/bin/sh "; |
| 380 | #endif |
| 381 | |
| 382 | for (cmCustomCommand const& cc : ccv) { |
| 383 | cmCustomCommandGenerator ccg(cc, this->ConfigName, this->LocalGenerator); |
| 384 | // Open the filestream for this custom command |
| 385 | std::string fname = cmStrCat(this->GeneratorTarget->GetSupportDirectory(), |
| 386 | '/', this->Name, '_', name, cmdcount++, fext); |
| 387 | |
| 388 | cmGeneratedFileStream f(fname); |
| 389 | f.SetCopyIfDifferent(true); |
| 390 | this->WriteCustomCommandsHelper(f, ccg); |
| 391 | f.Close(); |
| 392 | if (this->TagType != GhsMultiGpj::CUSTOM_TARGET) { |
| 393 | fout << " :" << cmd << "=\"" << shell << fname << "\"\n"; |
| 394 | } else { |
| 395 | fout << fname << "\n :outputName=\"" << fname << ".rule\"\n"; |
| 396 | } |
| 397 | for (auto const& byp : ccg.GetByproducts()) { |
| 398 | fout << " :extraOutputFile=\"" << byp << "\"\n"; |
| 399 | } |
| 400 | } |
| 401 | } |
| 402 | |
| 403 | void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper( |
| 404 | std::ostream& fout, cmCustomCommandGenerator const& ccg) |
no test coverage detected