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

Method WriteNvidiaDeviceLinkStatement

Source/cmNinjaNormalTargetGenerator.cxx:976–1123  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

974}
975
976void cmNinjaNormalTargetGenerator::WriteNvidiaDeviceLinkStatement(
977 std::string const& config, std::string const& fileConfig,
978 std::string const& outputDir, std::string const& output)
979{
980 cmGeneratorTarget* genTarget = this->GetGeneratorTarget();
981 cmGlobalNinjaGenerator* globalGen = this->GetGlobalGenerator();
982
983 std::string targetOutputImplib = this->ConvertToNinjaPath(
984 genTarget->GetFullPath(config, cmStateEnums::ImportLibraryArtifact));
985
986 if (config != fileConfig) {
987 std::string targetOutputFileConfigDir =
988 this->GetLocalGenerator()->MaybeRelativeToTopBinDir(
989 cmStrCat(genTarget->GetSupportDirectory(),
990 globalGen->ConfigDirectory(config), '/'));
991 targetOutputFileConfigDir =
992 globalGen->ExpandCFGIntDir(outputDir, fileConfig);
993 if (outputDir == targetOutputFileConfigDir) {
994 return;
995 }
996
997 if (!genTarget->GetFullName(config, cmStateEnums::ImportLibraryArtifact)
998 .empty() &&
999 !genTarget
1000 ->GetFullName(fileConfig, cmStateEnums::ImportLibraryArtifact)
1001 .empty() &&
1002 targetOutputImplib ==
1003 this->ConvertToNinjaPath(genTarget->GetFullPath(
1004 fileConfig, cmStateEnums::ImportLibraryArtifact))) {
1005 return;
1006 }
1007 }
1008
1009 // Compute the comment.
1010 cmNinjaBuild build(this->LanguageLinkerDeviceRule(config));
1011 build.Comment =
1012 cmStrCat("Link the ", this->GetVisibleTypeName(), ' ', output);
1013
1014 cmNinjaVars& vars = build.Variables;
1015
1016 // Compute outputs.
1017 build.Outputs.push_back(output);
1018 // Compute specific libraries to link with.
1019 build.ExplicitDeps = this->GetObjects(config);
1020 build.ImplicitDeps =
1021 this->ComputeLinkDeps(this->TargetLinkLanguage(config), config);
1022
1023 std::string frameworkPath;
1024 std::string linkPath;
1025
1026 std::string createRule =
1027 genTarget->GetCreateRuleVariable(this->TargetLinkLanguage(config), config);
1028 cmLocalNinjaGenerator& localGen = *this->GetLocalGenerator();
1029
1030 vars["TARGET_FILE"] =
1031 localGen.ConvertToOutputFormat(output, cmOutputConverter::SHELL);
1032
1033 cmNinjaLinkLineDeviceComputer linkLineComputer(

Callers 1

Calls 15

GetVisibleTypeNameMethod · 0.95
TargetLinkLanguageMethod · 0.95
TargetNamesMethod · 0.95
GetSupportDirectoryMethod · 0.80
push_backMethod · 0.80
GetObjectsMethod · 0.80
ComputeLinkDepsMethod · 0.80
GetCreateRuleVariableMethod · 0.80
SetUseNinjaMultiMethod · 0.80

Tested by

no test coverage detected