Xcode: Archives use STATIC_LIBRARY_FLAGS, not LINK_FLAGS
The LINK_FLAGS property is defined only for targets that really link. These include executables and shared libraries. For static libraries we define the STATIC_LIBRARY_FLAGS property. Teach the Xcode generator to make this distinction.
This commit is contained in:
parent
fe971d97ca
commit
5c49aa0c86
@ -1514,8 +1514,13 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
|
|||||||
extraLinkOptions = this->CurrentMakefile->
|
extraLinkOptions = this->CurrentMakefile->
|
||||||
GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS");
|
GetRequiredDefinition("CMAKE_MODULE_LINKER_FLAGS");
|
||||||
}
|
}
|
||||||
|
|
||||||
const char* targetLinkFlags = target.GetProperty("LINK_FLAGS");
|
const char* linkFlagsProp = "LINK_FLAGS";
|
||||||
|
if(target.GetType() == cmTarget::STATIC_LIBRARY)
|
||||||
|
{
|
||||||
|
linkFlagsProp = "STATIC_LIBRARY_FLAGS";
|
||||||
|
}
|
||||||
|
const char* targetLinkFlags = target.GetProperty(linkFlagsProp);
|
||||||
if(targetLinkFlags)
|
if(targetLinkFlags)
|
||||||
{
|
{
|
||||||
extraLinkOptions += " ";
|
extraLinkOptions += " ";
|
||||||
@ -1523,7 +1528,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
|
|||||||
}
|
}
|
||||||
if(configName && *configName)
|
if(configName && *configName)
|
||||||
{
|
{
|
||||||
std::string linkFlagsVar = "LINK_FLAGS_";
|
std::string linkFlagsVar = linkFlagsProp;
|
||||||
|
linkFlagsVar += "_";
|
||||||
linkFlagsVar += cmSystemTools::UpperCase(configName);
|
linkFlagsVar += cmSystemTools::UpperCase(configName);
|
||||||
if(const char* linkFlags = target.GetProperty(linkFlagsVar.c_str()))
|
if(const char* linkFlags = target.GetProperty(linkFlagsVar.c_str()))
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user