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

Method BuildMakeCommand

Source/cmExtraSublimeTextGenerator.cxx:313–340  ·  view source on GitHub ↗

Create the command line for building the given target using the selected make

Source from the content-addressed store, hash-verified

311// Create the command line for building the given target using the selected
312// make
313std::string cmExtraSublimeTextGenerator::BuildMakeCommand(
314 std::string const& make, std::string const& makefile,
315 std::string const& target)
316{
317 std::string command = cmStrCat('"', make, '"');
318 std::string generator = this->GlobalGenerator->GetName();
319 if (generator == "NMake Makefiles") {
320 std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile);
321 command = cmStrCat(std::move(command), R"(, "/NOLOGO", "/f", ")",
322 std::move(makefileName), "\", \"", target, '"');
323 } else if (generator == "Ninja") {
324 std::string makefileName = cmSystemTools::ConvertToOutputPath(makefile);
325 command = cmStrCat(std::move(command), R"(, "-f", ")",
326 std::move(makefileName), "\", \"", target, '"');
327 } else {
328 std::string makefileName;
329 if (generator == "MinGW Makefiles") {
330 // no escaping of spaces in this case, see
331 // https://gitlab.kitware.com/cmake/cmake/-/issues/10014
332 makefileName = makefile;
333 } else {
334 makefileName = cmSystemTools::ConvertToOutputPath(makefile);
335 }
336 command = cmStrCat(std::move(command), R"(, "-f", ")",
337 std::move(makefileName), "\", \"", target, '"');
338 }
339 return command;
340}
341
342// TODO: Most of the code is picked up from the Ninja generator, refactor it.
343std::string cmExtraSublimeTextGenerator::ComputeFlagsForObject(

Callers 1

AppendTargetMethod · 0.95

Calls 3

moveFunction · 0.85
cmStrCatFunction · 0.70
GetNameMethod · 0.45

Tested by

no test coverage detected