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

Method GetBuildCommand

Source/cmExtraCodeLiteGenerator.cxx:624–644  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

622}
623
624std::string cmExtraCodeLiteGenerator::GetBuildCommand(
625 cmMakefile const* mf, std::string const& targetName) const
626{
627 std::string const& generator = mf->GetSafeDefinition("CMAKE_GENERATOR");
628 std::string const& make = mf->GetRequiredDefinition("CMAKE_MAKE_PROGRAM");
629 std::string buildCommand = make; // Default
630 std::ostringstream ss;
631 if (generator == "NMake Makefiles" || generator == "Ninja") {
632 ss << make;
633 } else if (generator == "MinGW Makefiles" || generator == "Unix Makefiles") {
634 ss << make << " -f$(ProjectPath)/Makefile";
635 if (this->CpuCount > 0) {
636 ss << " -j " << this->CpuCount;
637 }
638 }
639 if (!targetName.empty()) {
640 ss << " " << targetName;
641 }
642 buildCommand = ss.str();
643 return buildCommand;
644}
645
646std::string cmExtraCodeLiteGenerator::GetCleanCommand(
647 cmMakefile const* mf, std::string const& targetName) const

Callers 3

GetCleanCommandMethod · 0.95
GetRebuildCommandMethod · 0.95

Calls 2

strMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected