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

Method GetArgv0Location

Source/cmCustomCommandGenerator.cxx:323–336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

321}
322
323char const* cmCustomCommandGenerator::GetArgv0Location(unsigned int c) const
324{
325 // If the command is the plain name of an executable target, we replace it
326 // with the path to the executable artifact in the command config.
327 std::string const& argv0 = this->CommandLines[c][0];
328 cmGeneratorTarget* target = this->LG->FindGeneratorTargetToUse(argv0);
329 if (target && target->GetType() == cmStateEnums::EXECUTABLE &&
330 (target->IsImported() ||
331 target->GetProperty("CROSSCOMPILING_EMULATOR") ||
332 !this->LG->GetMakefile()->IsOn("CMAKE_CROSSCOMPILING"))) {
333 return target->GetLocation(this->CommandConfig).c_str();
334 }
335 return nullptr;
336}
337
338bool cmCustomCommandGenerator::HasOnlyEmptyCommandLines() const
339{

Callers 2

GetCommandMethod · 0.95
AppendArgumentsMethod · 0.95

Calls 8

c_strMethod · 0.80
GetTypeMethod · 0.45
IsImportedMethod · 0.45
GetPropertyMethod · 0.45
IsOnMethod · 0.45
GetMakefileMethod · 0.45
GetLocationMethod · 0.45

Tested by

no test coverage detected