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