Fix configuration-dependent flag lookup in cmLocalGenerator::GetTargetFlags
Specifically, perform configuration-dependent lookup of STATIC_LIBRARY_FLAGS for static libraries, and use the correct prefix for configuration-dependent lookup of LINK_FLAGS (i.e. "LINK_FLAGS_", as opposed to the value of the LINK_FLAGS property).
This commit is contained in:
parent
557956f348
commit
fec4b63714
|
@ -1463,6 +1463,17 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
|
|||
linkFlags += targetLinkFlags;
|
||||
linkFlags += " ";
|
||||
}
|
||||
if(!buildType.empty())
|
||||
{
|
||||
std::string build = "STATIC_LIBRARY_FLAGS_";
|
||||
build += buildType;
|
||||
targetLinkFlags = target.GetProperty(build.c_str());
|
||||
if(targetLinkFlags)
|
||||
{
|
||||
linkFlags += targetLinkFlags;
|
||||
linkFlags += " ";
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
case cmTarget::MODULE_LIBRARY:
|
||||
|
@ -1471,7 +1482,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
|
|||
{
|
||||
linkFlags = this->Makefile->GetSafeDefinition(libraryLinkVariable);
|
||||
linkFlags += " ";
|
||||
if(buildType.size())
|
||||
if(!buildType.empty())
|
||||
{
|
||||
std::string build = libraryLinkVariable;
|
||||
build += "_";
|
||||
|
@ -1502,7 +1513,10 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
|
|||
{
|
||||
linkFlags += targetLinkFlags;
|
||||
linkFlags += " ";
|
||||
std::string configLinkFlags = targetLinkFlags;
|
||||
}
|
||||
if(!buildType.empty())
|
||||
{
|
||||
std::string configLinkFlags = "LINK_FLAGS_";
|
||||
configLinkFlags += buildType;
|
||||
targetLinkFlags = target.GetProperty(configLinkFlags.c_str());
|
||||
if(targetLinkFlags)
|
||||
|
@ -1521,7 +1535,7 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
|
|||
linkFlags +=
|
||||
this->Makefile->GetSafeDefinition("CMAKE_EXE_LINKER_FLAGS");
|
||||
linkFlags += " ";
|
||||
if(buildType.size())
|
||||
if(!buildType.empty())
|
||||
{
|
||||
std::string build = "CMAKE_EXE_LINKER_FLAGS_";
|
||||
build += buildType;
|
||||
|
@ -1573,8 +1587,11 @@ void cmLocalGenerator::GetTargetFlags(std::string& linkLibs,
|
|||
if(targetLinkFlags)
|
||||
{
|
||||
linkFlags += targetLinkFlags;
|
||||
linkFlags += " ";
|
||||
std::string configLinkFlags = targetLinkFlags;
|
||||
linkFlags += " ";
|
||||
}
|
||||
if(!buildType.empty())
|
||||
{
|
||||
std::string configLinkFlags = "LINK_FLAGS_";
|
||||
configLinkFlags += buildType;
|
||||
targetLinkFlags = target.GetProperty(configLinkFlags.c_str());
|
||||
if(targetLinkFlags)
|
||||
|
|
Loading…
Reference in New Issue