summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2010-05-28 17:23:31 (GMT)
committerBrad King <brad.king@kitware.com>2010-05-28 17:23:31 (GMT)
commit5c49aa0c8622b5253b6041e85ba32a5b5ce26d74 (patch)
treed4a3f2c72ef7111df7f81296d01895f9e8ffa0f8
parentfe971d97cae4df94d3643c5203b79336cfd31e05 (diff)
downloadCMake-5c49aa0c8622b5253b6041e85ba32a5b5ce26d74.zip
CMake-5c49aa0c8622b5253b6041e85ba32a5b5ce26d74.tar.gz
CMake-5c49aa0c8622b5253b6041e85ba32a5b5ce26d74.tar.bz2
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.
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx12
1 files changed, 9 insertions, 3 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 0d6e389..537a88f 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -1514,8 +1514,13 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
extraLinkOptions = this->CurrentMakefile->
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)
{
extraLinkOptions += " ";
@@ -1523,7 +1528,8 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
}
if(configName && *configName)
{
- std::string linkFlagsVar = "LINK_FLAGS_";
+ std::string linkFlagsVar = linkFlagsProp;
+ linkFlagsVar += "_";
linkFlagsVar += cmSystemTools::UpperCase(configName);
if(const char* linkFlags = target.GetProperty(linkFlagsVar.c_str()))
{