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

Method GenerateBuildCommand

Source/cmGlobalUnixMakefileGenerator3.cxx:534–578  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

532}
533
534std::vector<cmGlobalGenerator::GeneratedMakeCommand>
535cmGlobalUnixMakefileGenerator3::GenerateBuildCommand(
536 std::string const& makeProgram, std::string const& /*projectName*/,
537 std::string const& /*projectDir*/,
538 std::vector<std::string> const& targetNames, std::string const& /*config*/,
539 int jobs, bool verbose, cmBuildOptions buildOptions,
540 std::vector<std::string> const& makeOptions,
541 BuildTryCompile /*isInTryCompile*/)
542{
543 GeneratedMakeCommand makeCommand;
544
545 // Make it possible to set verbosity also from command line
546 if (verbose) {
547 makeCommand.Add(cmSystemTools::GetCMakeCommand());
548 makeCommand.Add("-E");
549 makeCommand.Add("env");
550 makeCommand.Add("VERBOSE=1");
551 }
552 makeCommand.Add(this->SelectMakeProgram(makeProgram));
553
554 // Explicitly tell the make tool to use the Makefile written by
555 // cmLocalUnixMakefileGenerator3::WriteLocalMakefile
556 makeCommand.Add("-f");
557 makeCommand.Add("Makefile");
558
559 if (jobs != cmake::NO_BUILD_PARALLEL_LEVEL) {
560 if (jobs == cmake::DEFAULT_BUILD_PARALLEL_LEVEL) {
561 makeCommand.Add("-j");
562 } else {
563 makeCommand.Add(cmStrCat("-j", jobs));
564 }
565 }
566
567 makeCommand.Add(makeOptions.begin(), makeOptions.end());
568 for (auto tname : targetNames) {
569 if (!tname.empty()) {
570 if (buildOptions.Fast) {
571 tname += "/fast";
572 }
573 cmSystemTools::ConvertToOutputSlashes(tname);
574 makeCommand.Add(std::move(tname));
575 }
576 }
577 return { std::move(makeCommand) };
578}
579
580void cmGlobalUnixMakefileGenerator3::WriteConvenienceRules(
581 std::ostream& ruleFileStream, std::set<std::string>& emitted)

Callers

nothing calls this directly

Calls 7

moveFunction · 0.85
SelectMakeProgramMethod · 0.80
cmStrCatFunction · 0.70
AddMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected