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

Method WriteSharedLibraryRules

Source/cmMakefileLibraryTargetGenerator.cxx:153–201  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153void cmMakefileLibraryTargetGenerator::WriteSharedLibraryRules(bool relink)
154{
155 if (this->GeneratorTarget->IsFrameworkOnApple()) {
156 this->WriteFrameworkRules(relink);
157 return;
158 }
159
160 if (!relink) {
161 bool const requiresDeviceLinking = requireDeviceLinking(
162 *this->GeneratorTarget, *this->LocalGenerator, this->GetConfigName());
163 if (requiresDeviceLinking) {
164 this->WriteDeviceLibraryRules("CMAKE_CUDA_DEVICE_LINK_LIBRARY", relink);
165 }
166 }
167
168 std::string linkLanguage =
169 this->GeneratorTarget->GetLinkerLanguage(this->GetConfigName());
170 std::string linkRuleVar =
171 cmStrCat("CMAKE_", linkLanguage, "_CREATE_SHARED_LIBRARY");
172
173 if (this->GeneratorTarget->IsArchivedAIXSharedLibrary()) {
174 linkRuleVar =
175 cmStrCat("CMAKE_", linkLanguage, "_CREATE_SHARED_LIBRARY_ARCHIVE");
176 }
177
178 std::string extraFlags;
179 this->LocalGenerator->AppendTargetCreationLinkFlags(
180 extraFlags, this->GeneratorTarget, linkLanguage);
181 this->LocalGenerator->AddTargetTypeLinkerFlags(
182 extraFlags, this->GeneratorTarget, linkLanguage, this->GetConfigName());
183 this->LocalGenerator->AddPerLanguageLinkFlags(
184 extraFlags, this->GeneratorTarget, linkLanguage, this->GetConfigName());
185
186 std::unique_ptr<cmLinkLineComputer> linkLineComputer =
187 this->CreateLinkLineComputer(
188 this->LocalGenerator,
189 this->LocalGenerator->GetStateSnapshot().GetDirectory());
190
191 this->LocalGenerator->AppendModuleDefinitionFlag(
192 extraFlags, this->GeneratorTarget, linkLineComputer.get(),
193 this->GetConfigName(), linkLanguage);
194
195 this->UseLWYU = this->LocalGenerator->AppendLWYUFlags(
196 extraFlags, this->GeneratorTarget, linkLanguage);
197
198 this->GetTargetLinkFlags(extraFlags, linkLanguage);
199
200 this->WriteLibraryRules(linkRuleVar, extraFlags, relink);
201}
202
203void cmMakefileLibraryTargetGenerator::WriteModuleLibraryRules(bool relink)
204{

Callers 1

WriteRuleFilesMethod · 0.95

Calls 15

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

Tested by

no test coverage detected