summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2014-07-29 12:52:17 (GMT)
committerCMake Topic Stage <kwrobot@kitware.com>2014-07-29 12:52:17 (GMT)
commit05d064fec3ad47a39ac62f9a579472aa238c3f24 (patch)
tree87b01ae481d6ebfdbae7ff10a0a6557f1f174c30 /Source
parent99a9034759c562ebad9be6e9b1fa111c3cb97daf (diff)
parent608cf8149ccbf8954926ab7c86fd658099a52f7b (diff)
downloadCMake-05d064fec3ad47a39ac62f9a579472aa238c3f24.zip
CMake-05d064fec3ad47a39ac62f9a579472aa238c3f24.tar.gz
CMake-05d064fec3ad47a39ac62f9a579472aa238c3f24.tar.bz2
Merge topic 'xcode-6-librarian-flags'
608cf814 Xcode: Fix static library creation for Xcode 6 (#15038)
Diffstat (limited to 'Source')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx28
-rw-r--r--Source/cmGlobalXCodeGenerator.h1
2 files changed, 24 insertions, 5 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index 9a36df5..ee5fc00 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -2299,7 +2299,7 @@ void cmGlobalXCodeGenerator::CreateBuildSettings(cmTarget& target,
}
}
- buildSettings->AddAttribute("OTHER_LDFLAGS",
+ buildSettings->AddAttribute(this->GetTargetLinkFlagsVar(target),
this->CreateString(extraLinkOptions.c_str()));
buildSettings->AddAttribute("OTHER_REZFLAGS",
this->CreateString(""));
@@ -2527,6 +2527,22 @@ std::string cmGlobalXCodeGenerator::AddConfigurations(cmXCodeObject* target,
}
//----------------------------------------------------------------------------
+const char*
+cmGlobalXCodeGenerator::GetTargetLinkFlagsVar(cmTarget const& cmtarget) const
+{
+ if(this->XcodeVersion >= 60 &&
+ (cmtarget.GetType() == cmTarget::STATIC_LIBRARY ||
+ cmtarget.GetType() == cmTarget::OBJECT_LIBRARY))
+ {
+ return "OTHER_LIBTOOLFLAGS";
+ }
+ else
+ {
+ return "OTHER_LDFLAGS";
+ }
+}
+
+//----------------------------------------------------------------------------
const char* cmGlobalXCodeGenerator::GetTargetFileType(cmTarget& cmtarget)
{
switch(cmtarget.GetType())
@@ -2835,8 +2851,9 @@ void cmGlobalXCodeGenerator
sep = " ";
linkObjs += this->XCodeEscapePath(oi->c_str());
}
- this->AppendBuildSettingAttribute(target, "OTHER_LDFLAGS",
- linkObjs.c_str(), configName);
+ this->AppendBuildSettingAttribute(
+ target, this->GetTargetLinkFlagsVar(*cmtarget),
+ linkObjs.c_str(), configName);
}
// Skip link information for object libraries.
@@ -2914,8 +2931,9 @@ void cmGlobalXCodeGenerator
target->AddDependTarget(configName, li->Target->GetName());
}
}
- this->AppendBuildSettingAttribute(target, "OTHER_LDFLAGS",
- linkLibs.c_str(), configName);
+ this->AppendBuildSettingAttribute(
+ target, this->GetTargetLinkFlagsVar(*cmtarget),
+ linkLibs.c_str(), configName);
}
}
}
diff --git a/Source/cmGlobalXCodeGenerator.h b/Source/cmGlobalXCodeGenerator.h
index fcdd349..4fe04fc 100644
--- a/Source/cmGlobalXCodeGenerator.h
+++ b/Source/cmGlobalXCodeGenerator.h
@@ -134,6 +134,7 @@ private:
cmXCodeObject* buildPhases);
void ForceLinkerLanguages();
void ForceLinkerLanguage(cmTarget& cmtarget);
+ const char* GetTargetLinkFlagsVar(cmTarget const& cmtarget) const;
const char* GetTargetFileType(cmTarget& cmtarget);
const char* GetTargetProductType(cmTarget& cmtarget);
std::string AddConfigurations(cmXCodeObject* target, cmTarget& cmtarget);