diff options
Diffstat (limited to 'Source/cmLocalGenerator.cxx')
-rw-r--r-- | Source/cmLocalGenerator.cxx | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/Source/cmLocalGenerator.cxx b/Source/cmLocalGenerator.cxx index 0a78af6..55f61ea 100644 --- a/Source/cmLocalGenerator.cxx +++ b/Source/cmLocalGenerator.cxx @@ -1293,14 +1293,15 @@ std::vector<BT<std::string>> cmLocalGenerator::GetStaticLibraryFlags( std::string const& config, std::string const& linkLanguage, cmGeneratorTarget* target) { + const std::string configUpper = cmSystemTools::UpperCase(config); std::vector<BT<std::string>> flags; if (linkLanguage != "Swift") { std::string staticLibFlags; this->AppendFlags( staticLibFlags, this->Makefile->GetSafeDefinition("CMAKE_STATIC_LINKER_FLAGS")); - if (!config.empty()) { - std::string name = "CMAKE_STATIC_LINKER_FLAGS_" + config; + if (!configUpper.empty()) { + std::string name = "CMAKE_STATIC_LINKER_FLAGS_" + configUpper; this->AppendFlags(staticLibFlags, this->Makefile->GetSafeDefinition(name)); } @@ -1312,8 +1313,8 @@ std::vector<BT<std::string>> cmLocalGenerator::GetStaticLibraryFlags( std::string staticLibFlags; this->AppendFlags(staticLibFlags, target->GetSafeProperty("STATIC_LIBRARY_FLAGS")); - if (!config.empty()) { - std::string name = "STATIC_LIBRARY_FLAGS_" + config; + if (!configUpper.empty()) { + std::string name = "STATIC_LIBRARY_FLAGS_" + configUpper; this->AppendFlags(staticLibFlags, target->GetSafeProperty(name)); } @@ -1350,17 +1351,17 @@ 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, config); switch (target->GetType()) { case cmStateEnums::STATIC_LIBRARY: - linkFlags = this->GetStaticLibraryFlags(buildType, linkLanguage, target); + linkFlags = this->GetStaticLibraryFlags(config, linkLanguage, target); if (pcli && dynamic_cast<cmLinkLineDeviceComputer*>(linkLineComputer)) { // Compute the required cuda device link libraries when // resolving cuda device symbols @@ -1376,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 += " "; } @@ -1385,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, config); std::string defFlag = this->Makefile->GetSafeDefinition("CMAKE_LINK_DEF_FILE_FLAG"); for (cmSourceFile* sf : sources) { @@ -1404,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 += " "; @@ -1431,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()) { @@ -1460,7 +1461,7 @@ void cmLocalGenerator::GetTargetFlags( } } - this->AddLanguageFlagsForLinking(flags, target, linkLanguage, buildType); + this->AddLanguageFlagsForLinking(flags, target, linkLanguage, config); if (pcli) { this->OutputLinkLibraries(pcli, linkLineComputer, linkLibs, frameworkPath, linkPath); @@ -1485,9 +1486,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 += " "; |