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

Method AppendTargetCreationLinkFlags

Source/cmLocalGenerator.cxx:3422–3457  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3420}
3421
3422void cmLocalGenerator::AppendTargetCreationLinkFlags(
3423 std::string& flags, cmGeneratorTarget const* target,
3424 std::string const& linkLanguage)
3425{
3426 std::string createFlagsVar;
3427 cmValue createFlagsVal;
3428 switch (target->GetType()) {
3429 case cmStateEnums::STATIC_LIBRARY:
3430 break;
3431 case cmStateEnums::MODULE_LIBRARY:
3432 createFlagsVar =
3433 cmStrCat("CMAKE_SHARED_MODULE_CREATE_", linkLanguage, "_FLAGS");
3434 createFlagsVal = this->Makefile->GetDefinition(createFlagsVar);
3435 // On some platforms we use shared library creation flags for modules.
3436 CM_FALLTHROUGH;
3437 case cmStateEnums::SHARED_LIBRARY:
3438 if (!createFlagsVal) {
3439 createFlagsVar =
3440 cmStrCat("CMAKE_SHARED_LIBRARY_CREATE_", linkLanguage, "_FLAGS");
3441 createFlagsVal = this->Makefile->GetDefinition(createFlagsVar);
3442 }
3443 break;
3444 case cmStateEnums::EXECUTABLE:
3445 createFlagsVar = target->GetPolicyStatusCMP0210() == cmPolicies::NEW
3446 ? cmStrCat("CMAKE_EXECUTABLE_CREATE_", linkLanguage, "_FLAGS")
3447 : cmStrCat("CMAKE_", linkLanguage, "_LINK_FLAGS");
3448 createFlagsVal = this->Makefile->GetDefinition(createFlagsVar);
3449 break;
3450 default:
3451 break;
3452 }
3453 if (createFlagsVal) {
3454 this->AppendFlags(flags, *createFlagsVal, createFlagsVar, target,
3455 cmBuildStep::Link, linkLanguage);
3456 }
3457}
3458
3459void cmLocalGenerator::AppendLinkerTypeFlags(std::string& flags,
3460 cmGeneratorTarget* target,

Callers 6

GetTargetFlagsMethod · 0.95
CreateBuildSettingsMethod · 0.80
WriteExecutableRuleMethod · 0.80
WriteFrameworkRulesMethod · 0.80

Calls 4

AppendFlagsMethod · 0.95
cmStrCatFunction · 0.70
GetTypeMethod · 0.45
GetDefinitionMethod · 0.45

Tested by

no test coverage detected