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

Method GetAppleTextStubCommand

Source/cmFastbuildTargetGenerator.cxx:452–503  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

450}
451
452FastbuildExecNode cmFastbuildTargetGenerator::GetAppleTextStubCommand() const
453{
454 FastbuildExecNode res;
455 if (!this->GeneratorTarget->IsApple() ||
456 !this->GeneratorTarget->HasImportLibrary(Config)) {
457 return res;
458 }
459
460 auto const names = DetectOutput();
461 std::string const outpathImp =
462 this->ConvertToFastbuildPath(this->GeneratorTarget->GetDirectory(
463 Config, cmStateEnums::ImportLibraryArtifact));
464
465 std::string const binPath =
466 this->ConvertToFastbuildPath(this->GeneratorTarget->GetDirectory(
467 Config, cmStateEnums::RuntimeBinaryArtifact));
468
469 cmSystemTools::MakeDirectory(outpathImp);
470
471 std::string rule = this->LocalGenerator->GetMakefile()->GetSafeDefinition(
472 "CMAKE_CREATE_TEXT_STUBS");
473 LogMessage("CMAKE_CREATE_TEXT_STUBS:" + rule);
474
475 auto rulePlaceholderExpander =
476 this->GetLocalGenerator()->CreateRulePlaceholderExpander();
477
478 cmRulePlaceholderExpander::RuleVariables vars;
479 res.ExecOutput = cmStrCat(outpathImp, '/', names.ImportReal);
480 res.ExecInput = { cmStrCat(binPath, '/', names.SharedObject) };
481
482 vars.Target = res.ExecInput[0].c_str();
483 rulePlaceholderExpander->SetTargetImpLib(res.ExecOutput);
484 rulePlaceholderExpander->ExpandRuleVariables(this->GetLocalGenerator(), rule,
485 vars);
486
487 LogMessage("CMAKE_CREATE_TEXT_STUBS expanded:" + rule);
488 std::string executable;
489 std::string args;
490 if (!cmSystemTools::SplitProgramFromArgs(rule, executable, args)) {
491 cmSystemTools::Error("Failed to split program from args: " + rule);
492 return res;
493 }
494
495 res.Name = cmStrCat("create_", names.ImportOutput, "_text_stub");
496 res.ExecExecutable = std::move(executable);
497 res.ExecArguments = std::move(args);
498 res.ExecWorkingDir = this->LocalCommonGenerator->GetCurrentBinaryDirectory();
499
500 // Wait for the build.
501 res.PreBuildDependencies.emplace(this->GetTargetName());
502 return res;
503}
504FastbuildExecNode cmFastbuildTargetGenerator::GetDepsCheckExec(
505 FastbuildExecNode const& depender)
506{

Callers

nothing calls this directly

Calls 15

GetLocalGeneratorMethod · 0.95
GetTargetNameMethod · 0.95
moveFunction · 0.85
HasImportLibraryMethod · 0.80
c_strMethod · 0.80
SetTargetImpLibMethod · 0.80
ExpandRuleVariablesMethod · 0.80
emplaceMethod · 0.80
cmStrCatFunction · 0.70
ErrorClass · 0.70
IsAppleMethod · 0.45

Tested by

no test coverage detected