MCPcopy Index your code
hub / github.com/Kitware/CMake / WriteModuleLibraryRules

Method WriteModuleLibraryRules

Source/cmMakefileLibraryTargetGenerator.cxx:203–241  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

201}
202
203void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
204{
205 if (!relink) {
206 bool const requiresDeviceLinking = requireDeviceLinking(
207 *this->GeneratorTarget, *this->LocalGenerator, this->GetConfigName());
208 if (requiresDeviceLinking) {
209 this->WriteDeviceLibraryRules("CMAKE_CUDA_DEVICE_LINK_LIBRARY", relink);
210 }
211 }
212
213 std::string linkLanguage =
214 this->GeneratorTarget->GetLinkerLanguage(this->GetConfigName());
215 std::string linkRuleVar =
216 cmStrCat("CMAKE_", linkLanguage, "_CREATE_SHARED_MODULE");
217
218 std::string extraFlags;
219 this->LocalGenerator->AppendTargetCreationLinkFlags(
220 extraFlags, this->GeneratorTarget, linkLanguage);
221 this->LocalGenerator->AddTargetTypeLinkerFlags(
222 extraFlags, this->GeneratorTarget, linkLanguage, this->GetConfigName());
223 this->LocalGenerator->AddPerLanguageLinkFlags(
224 extraFlags, this->GeneratorTarget, linkLanguage, this->GetConfigName());
225
226 std::unique_ptr<cmLinkLineComputer> linkLineComputer =
227 this->CreateLinkLineComputer(
228 this->LocalGenerator,
229 this->LocalGenerator->GetStateSnapshot().GetDirectory());
230
231 this->LocalGenerator->AppendModuleDefinitionFlag(
232 extraFlags, this->GeneratorTarget, linkLineComputer.get(),
233 this->GetConfigName(), linkLanguage);
234
235 this->UseLWYU = this->LocalGenerator->AppendLWYUFlags(
236 extraFlags, this->GeneratorTarget, linkLanguage);
237
238 this->GetTargetLinkFlags(extraFlags, linkLanguage);
239
240 this->WriteLibraryRules(linkRuleVar, extraFlags, relink);
241}
242
243void cmMakefileLibraryTargetGenerator::WriteFrameworkRules(bool relink)
244{

Callers 1

WriteRuleFilesMethod · 0.95

Calls 14

WriteLibraryRulesMethod · 0.95
requireDeviceLinkingFunction · 0.85
AppendLWYUFlagsMethod · 0.80
GetTargetLinkFlagsMethod · 0.80
cmStrCatFunction · 0.70
GetLinkerLanguageMethod · 0.45
GetDirectoryMethod · 0.45

Tested by

no test coverage detected