| 466 | } |
| 467 | |
| 468 | std::vector<cmGlobalGenerator::GeneratedMakeCommand> |
| 469 | cmGlobalGhsMultiGenerator::GenerateBuildCommand( |
| 470 | std::string const& makeProgram, std::string const& projectName, |
| 471 | std::string const& projectDir, std::vector<std::string> const& targetNames, |
| 472 | std::string const& /*config*/, int jobs, bool verbose, |
| 473 | cmBuildOptions /*buildOptions*/, std::vector<std::string> const& makeOptions, |
| 474 | BuildTryCompile /*isInTryCompile*/) |
| 475 | { |
| 476 | GeneratedMakeCommand makeCommand; |
| 477 | |
| 478 | makeCommand.Add(this->SelectMakeProgram(makeProgram)); |
| 479 | |
| 480 | if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) { |
| 481 | if (jobs == cmake::DEFAULT_BUILD_PARALLEL_LEVEL) { |
| 482 | makeCommand.Add("-parallel"); |
| 483 | } else { |
| 484 | makeCommand.Add(std::string("-parallel=") + std::to_string(jobs)); |
| 485 | } |
| 486 | } |
| 487 | |
| 488 | /* determine the top-project file in the project directory */ |
| 489 | std::string proj = projectName + ".top" + FILE_EXTENSION; |
| 490 | std::vector<std::string> files; |
| 491 | cmSystemTools::Glob(projectDir, ".*\\.top\\.gpj", files); |
| 492 | if (!files.empty()) { |
| 493 | /* use the real top-level project in the directory */ |
| 494 | proj = files.at(0); |
| 495 | } |
| 496 | makeCommand.Add("-top", proj); |
| 497 | |
| 498 | /* determine targets to build */ |
| 499 | bool build_all = false; |
| 500 | if (!targetNames.empty()) { |
| 501 | for (auto const& tname : targetNames) { |
| 502 | if (!tname.empty()) { |
| 503 | if (tname == "clean") { |
| 504 | makeCommand.Add("-clean"); |
| 505 | } else { |
| 506 | makeCommand.Add(tname + ".tgt.gpj"); |
| 507 | } |
| 508 | } else { |
| 509 | build_all = true; |
| 510 | } |
| 511 | } |
| 512 | } else { |
| 513 | build_all = true; |
| 514 | } |
| 515 | |
| 516 | if (build_all) { |
| 517 | /* transform name to default build */; |
| 518 | std::string all = std::string(this->GetAllTargetName()) + ".tgt.gpj"; |
| 519 | makeCommand.Add(all); |
| 520 | } |
| 521 | |
| 522 | if (verbose) { |
| 523 | makeCommand.Add("-commands"); |
| 524 | } |
| 525 | makeCommand.Add(makeOptions.begin(), makeOptions.end()); |
nothing calls this directly
no test coverage detected