mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-11 03:50:43 -05:00
cmLocalGenerator: Clarify local variable name in GetTargetFlags
This commit is contained in:
@@ -1351,13 +1351,13 @@ void cmLocalGenerator::GetTargetFlags(
|
||||
std::vector<BT<std::string>>& linkFlags, std::string& frameworkPath,
|
||||
std::vector<BT<std::string>>& linkPath, cmGeneratorTarget* target)
|
||||
{
|
||||
const std::string buildType = cmSystemTools::UpperCase(config);
|
||||
const std::string configUpper = cmSystemTools::UpperCase(config);
|
||||
cmComputeLinkInformation* pcli = target->GetLinkInformation(config);
|
||||
const char* libraryLinkVariable =
|
||||
"CMAKE_SHARED_LINKER_FLAGS"; // default to shared library
|
||||
|
||||
const std::string linkLanguage =
|
||||
linkLineComputer->GetLinkerLanguage(target, buildType);
|
||||
linkLineComputer->GetLinkerLanguage(target, configUpper);
|
||||
|
||||
switch (target->GetType()) {
|
||||
case cmStateEnums::STATIC_LIBRARY:
|
||||
@@ -1377,8 +1377,8 @@ void cmLocalGenerator::GetTargetFlags(
|
||||
if (linkLanguage != "Swift") {
|
||||
sharedLibFlags = cmStrCat(
|
||||
this->Makefile->GetSafeDefinition(libraryLinkVariable), ' ');
|
||||
if (!buildType.empty()) {
|
||||
std::string build = cmStrCat(libraryLinkVariable, '_', buildType);
|
||||
if (!configUpper.empty()) {
|
||||
std::string build = cmStrCat(libraryLinkVariable, '_', configUpper);
|
||||
sharedLibFlags += this->Makefile->GetSafeDefinition(build);
|
||||
sharedLibFlags += " ";
|
||||
}
|
||||
@@ -1386,7 +1386,7 @@ void cmLocalGenerator::GetTargetFlags(
|
||||
!(this->Makefile->IsOn("CYGWIN") ||
|
||||
this->Makefile->IsOn("MINGW"))) {
|
||||
std::vector<cmSourceFile*> sources;
|
||||
target->GetSourceFiles(sources, buildType);
|
||||
target->GetSourceFiles(sources, configUpper);
|
||||
std::string defFlag =
|
||||
this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG");
|
||||
for (cmSourceFile* sf : sources) {
|
||||
@@ -1405,9 +1405,9 @@ void cmLocalGenerator::GetTargetFlags(
|
||||
sharedLibFlags += targetLinkFlags;
|
||||
sharedLibFlags += " ";
|
||||
}
|
||||
if (!buildType.empty()) {
|
||||
if (!configUpper.empty()) {
|
||||
targetLinkFlags =
|
||||
target->GetProperty(cmStrCat("LINK_FLAGS_", buildType));
|
||||
target->GetProperty(cmStrCat("LINK_FLAGS_", configUpper));
|
||||
if (targetLinkFlags) {
|
||||
sharedLibFlags += targetLinkFlags;
|
||||
sharedLibFlags += " ";
|
||||
@@ -1432,9 +1432,9 @@ void cmLocalGenerator::GetTargetFlags(
|
||||
if (linkLanguage != "Swift") {
|
||||
exeFlags = this->Makefile->GetSafeDefinition("CMAKE_EXE_LINKER_FLAGS");
|
||||
exeFlags += " ";
|
||||
if (!buildType.empty()) {
|
||||
if (!configUpper.empty()) {
|
||||
exeFlags += this->Makefile->GetSafeDefinition(
|
||||
cmStrCat("CMAKE_EXE_LINKER_FLAGS_", buildType));
|
||||
cmStrCat("CMAKE_EXE_LINKER_FLAGS_", configUpper));
|
||||
exeFlags += " ";
|
||||
}
|
||||
if (linkLanguage.empty()) {
|
||||
@@ -1461,7 +1461,8 @@ void cmLocalGenerator::GetTargetFlags(
|
||||
}
|
||||
}
|
||||
|
||||
this->AddLanguageFlagsForLinking(flags, target, linkLanguage, buildType);
|
||||
this->AddLanguageFlagsForLinking(flags, target, linkLanguage,
|
||||
configUpper);
|
||||
if (pcli) {
|
||||
this->OutputLinkLibraries(pcli, linkLineComputer, linkLibs,
|
||||
frameworkPath, linkPath);
|
||||
@@ -1486,9 +1487,9 @@ void cmLocalGenerator::GetTargetFlags(
|
||||
exeFlags += targetLinkFlags;
|
||||
exeFlags += " ";
|
||||
}
|
||||
if (!buildType.empty()) {
|
||||
if (!configUpper.empty()) {
|
||||
targetLinkFlags =
|
||||
target->GetProperty(cmStrCat("LINK_FLAGS_", buildType));
|
||||
target->GetProperty(cmStrCat("LINK_FLAGS_", configUpper));
|
||||
if (targetLinkFlags) {
|
||||
exeFlags += targetLinkFlags;
|
||||
exeFlags += " ";
|
||||
|
||||
Reference in New Issue
Block a user