mirror of
https://github.com/Kitware/CMake.git
synced 2026-03-11 12:00:48 -05:00
cmLocalGenerator: Convert GetStaticLibraryFlags to take original-case config
Move upper-case conversion of the configuration into the implementation.
This commit is contained in:
@@ -1861,7 +1861,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmGeneratorTarget* gtgt,
|
||||
if (gtgt->GetType() == cmStateEnums::OBJECT_LIBRARY ||
|
||||
gtgt->GetType() == cmStateEnums::STATIC_LIBRARY) {
|
||||
this->CurrentLocalGenerator->GetStaticLibraryFlags(
|
||||
extraLinkOptions, cmSystemTools::UpperCase(configName), llang, gtgt);
|
||||
extraLinkOptions, configName, llang, gtgt);
|
||||
} else {
|
||||
const char* targetLinkFlags = gtgt->GetProperty("LINK_FLAGS");
|
||||
if (targetLinkFlags) {
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
|
||||
@@ -1360,7 +1361,7 @@ void cmLocalGenerator::GetTargetFlags(
|
||||
|
||||
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
|
||||
|
||||
@@ -1004,9 +1004,8 @@ void cmLocalVisualStudio7Generator::OutputBuildTool(
|
||||
}
|
||||
}
|
||||
std::string libflags;
|
||||
this->GetStaticLibraryFlags(libflags, configTypeUpper,
|
||||
target->GetLinkerLanguage(configName),
|
||||
target);
|
||||
this->GetStaticLibraryFlags(
|
||||
libflags, configName, target->GetLinkerLanguage(configName), target);
|
||||
if (!libflags.empty()) {
|
||||
fout << "\t\t\t\tAdditionalOptions=\"" << libflags << "\"\n";
|
||||
}
|
||||
|
||||
@@ -141,8 +141,7 @@ void cmMakefileLibraryTargetGenerator::WriteStaticLibraryRules()
|
||||
|
||||
std::string extraFlags;
|
||||
this->LocalGenerator->GetStaticLibraryFlags(
|
||||
extraFlags, cmSystemTools::UpperCase(this->GetConfigName()), linkLanguage,
|
||||
this->GeneratorTarget);
|
||||
extraFlags, this->GetConfigName(), linkLanguage, this->GeneratorTarget);
|
||||
this->WriteLibraryRules(linkRuleVar, extraFlags, false);
|
||||
}
|
||||
|
||||
|
||||
@@ -3409,9 +3409,8 @@ void cmVisualStudio10TargetGenerator::WriteLibOptions(
|
||||
this->GeneratorTarget->GetLinkClosure(config)->LinkerLanguage;
|
||||
|
||||
std::string libflags;
|
||||
this->LocalGenerator->GetStaticLibraryFlags(
|
||||
libflags, cmSystemTools::UpperCase(config), linkLanguage,
|
||||
this->GeneratorTarget);
|
||||
this->LocalGenerator->GetStaticLibraryFlags(libflags, config, linkLanguage,
|
||||
this->GeneratorTarget);
|
||||
if (!libflags.empty()) {
|
||||
Elem e2(e1, "Lib");
|
||||
cmGlobalVisualStudio10Generator* gg = this->GlobalGenerator;
|
||||
|
||||
Reference in New Issue
Block a user