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

Method WriteBuildEventsHelper

Source/cmGhsMultiTargetGenerator.cxx:369–401  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

367}
368
369void 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
403void cmGhsMultiTargetGenerator::WriteCustomCommandsHelper(
404 std::ostream& fout, cmCustomCommandGenerator const& ccg)

Callers 1

WriteBuildEventsMethod · 0.95

Calls 5

GetSupportDirectoryMethod · 0.80
SetCopyIfDifferentMethod · 0.80
CloseMethod · 0.80
cmStrCatFunction · 0.70

Tested by

no test coverage detected