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

Method WriteLinkStatement

Source/cmNinjaNormalTargetGenerator.cxx:1125–1745  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1123}
1124
1125void cmNinjaNormalTargetGenerator::WriteLinkStatement(
1126 std::string const& config, std::string const& fileConfig,
1127 bool firstForConfig)
1128{
1129 cmMakefile* mf = this->GetMakefile();
1130 cmGlobalNinjaGenerator* globalGen = this->GetGlobalGenerator();
1131 cmGeneratorTarget* gt = this->GetGeneratorTarget();
1132
1133 std::string targetOutput = this->ConvertToNinjaPath(gt->GetFullPath(config));
1134 std::string targetOutputReal = this->ConvertToNinjaPath(
1135 gt->GetFullPath(config, cmStateEnums::RuntimeBinaryArtifact,
1136 /*realname=*/true));
1137 std::string targetOutputImplib = this->ConvertToNinjaPath(
1138 gt->GetFullPath(config, cmStateEnums::ImportLibraryArtifact));
1139
1140 if (config != fileConfig) {
1141 if (targetOutput ==
1142 this->ConvertToNinjaPath(gt->GetFullPath(fileConfig))) {
1143 return;
1144 }
1145 if (targetOutputReal ==
1146 this->ConvertToNinjaPath(
1147 gt->GetFullPath(fileConfig, cmStateEnums::RuntimeBinaryArtifact,
1148 /*realname=*/true))) {
1149 return;
1150 }
1151 if (!gt->GetFullName(config, cmStateEnums::ImportLibraryArtifact)
1152 .empty() &&
1153 !gt->GetFullName(fileConfig, cmStateEnums::ImportLibraryArtifact)
1154 .empty() &&
1155 targetOutputImplib ==
1156 this->ConvertToNinjaPath(gt->GetFullPath(
1157 fileConfig, cmStateEnums::ImportLibraryArtifact))) {
1158 return;
1159 }
1160 }
1161
1162 auto const tgtNames = this->TargetNames(config);
1163 if (gt->IsAppBundleOnApple()) {
1164 // Create the app bundle
1165 std::string outpath = gt->GetDirectory(config);
1166 this->OSXBundleGenerator->CreateAppBundle(tgtNames.Output, outpath,
1167 config);
1168
1169 // Calculate the output path
1170 targetOutput = cmStrCat(outpath, '/', tgtNames.Output);
1171 targetOutput = this->ConvertToNinjaPath(targetOutput);
1172 targetOutputReal = cmStrCat(outpath, '/', tgtNames.Real);
1173 targetOutputReal = this->ConvertToNinjaPath(targetOutputReal);
1174 } else if (gt->IsFrameworkOnApple()) {
1175 // Create the library framework.
1176
1177 cmOSXBundleGenerator::SkipParts bundleSkipParts;
1178 if (globalGen->GetName() == "Ninja Multi-Config") {
1179 auto const postFix = this->GeneratorTarget->GetFilePostfix(config);
1180 // Skip creating Info.plist when there are multiple configurations, and
1181 // the current configuration has a postfix. The non-postfix configuration
1182 // Info.plist can be used by all the other configurations.

Callers 1

GenerateMethod · 0.95

Calls 15

TargetNamesMethod · 0.95
LanguageLinkerRuleMethod · 0.95
GetVisibleTypeNameMethod · 0.95
TargetLinkLanguageMethod · 0.95
WriteLinkRuleMethod · 0.95
transformFunction · 0.85
cmNonemptyFunction · 0.85
moveFunction · 0.85
cmHasLiteralSuffixFunction · 0.85
CreateAppBundleMethod · 0.80
GetFilePostfixMethod · 0.80

Tested by

no test coverage detected