diff options
author | Brad King <brad.king@kitware.com> | 2017-04-13 12:15:22 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2017-04-13 12:15:25 (GMT) |
commit | e155fba644d4686ac8b4f43dfe31c749bba30c67 (patch) | |
tree | 2a502a6506bfbaeb4dbb7afd0dd7de2d4d1dd083 /Source/cmGlobalXCodeGenerator.cxx | |
parent | 0d928d2fed11472ac1d8cb64e469b3ac86bf4975 (diff) | |
parent | 229abfc8f945421c9ad491dff674e41d283ca80f (diff) | |
download | CMake-e155fba644d4686ac8b4f43dfe31c749bba30c67.zip CMake-e155fba644d4686ac8b4f43dfe31c749bba30c67.tar.gz CMake-e155fba644d4686ac8b4f43dfe31c749bba30c67.tar.bz2 |
Merge topic 'xcode-remove-UseObjectLibraries'
229abfc8 cmGeneratorTarget: Drop unused UseObjectLibraries method
63fbf587 Xcode: Inline relevant parts of UseObjectLibraries
1afacebe Xcode: Do not add Object Libraries source group on Xcode >= 5
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !698
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r-- | Source/cmGlobalXCodeGenerator.cxx | 51 |
1 files changed, 32 insertions, 19 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx index ebc874a..10343fd 100644 --- a/Source/cmGlobalXCodeGenerator.cxx +++ b/Source/cmGlobalXCodeGenerator.cxx @@ -1051,11 +1051,14 @@ bool cmGlobalXCodeGenerator::CreateXCodeTargets( // Add object library contents as external objects. (Equivalent to // the externalObjFiles above, except each one is not a cmSourceFile // within the target.) - std::vector<std::string> objs; - gtgt->UseObjectLibraries(objs, ""); - for (std::vector<std::string>::const_iterator oi = objs.begin(); + std::vector<cmSourceFile const*> objs; + gtgt->GetExternalObjects(objs, ""); + for (std::vector<cmSourceFile const*>::const_iterator oi = objs.begin(); oi != objs.end(); ++oi) { - std::string obj = *oi; + if ((*oi)->GetObjectLibrary().empty()) { + continue; + } + std::string const& obj = (*oi)->GetFullPath(); cmXCodeObject* xsf = this->CreateXCodeSourceFileFromPath(obj, gtgt, "", 0); externalObjFiles.push_back(xsf); @@ -2669,13 +2672,16 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target) // Add object library contents as link flags. std::string linkObjs; const char* sep = ""; - std::vector<std::string> objs; - gt->UseObjectLibraries(objs, ""); - for (std::vector<std::string>::const_iterator oi = objs.begin(); + std::vector<cmSourceFile const*> objs; + gt->GetExternalObjects(objs, ""); + for (std::vector<cmSourceFile const*>::const_iterator oi = objs.begin(); oi != objs.end(); ++oi) { + if ((*oi)->GetObjectLibrary().empty()) { + continue; + } linkObjs += sep; sep = " "; - linkObjs += this->XCodeEscapePath(*oi); + linkObjs += this->XCodeEscapePath((*oi)->GetFullPath()); } this->AppendBuildSettingAttribute( target, this->GetTargetLinkFlagsVar(gt), linkObjs.c_str(), configName); @@ -2799,17 +2805,24 @@ bool cmGlobalXCodeGenerator::CreateGroups( this->GroupMap[key] = pbxgroup; } - // Put OBJECT_LIBRARY objects in proper groups: - std::vector<std::string> objs; - gtgt->UseObjectLibraries(objs, ""); - for (std::vector<std::string>::const_iterator oi = objs.begin(); - oi != objs.end(); ++oi) { - std::string const& source = *oi; - cmSourceGroup* sourceGroup = - mf->FindSourceGroup(source.c_str(), sourceGroups); - cmXCodeObject* pbxgroup = this->CreateOrGetPBXGroup(gtgt, sourceGroup); - std::string key = GetGroupMapKeyFromPath(gtgt, source); - this->GroupMap[key] = pbxgroup; + if (this->XcodeVersion < 50) { + // Put OBJECT_LIBRARY objects in proper groups: + std::vector<cmSourceFile const*> objs; + gtgt->GetExternalObjects(objs, ""); + for (std::vector<cmSourceFile const*>::const_iterator oi = + objs.begin(); + oi != objs.end(); ++oi) { + if ((*oi)->GetObjectLibrary().empty()) { + continue; + } + std::string const& source = (*oi)->GetFullPath(); + cmSourceGroup* sourceGroup = + mf->FindSourceGroup(source.c_str(), sourceGroups); + cmXCodeObject* pbxgroup = + this->CreateOrGetPBXGroup(gtgt, sourceGroup); + std::string key = GetGroupMapKeyFromPath(gtgt, source); + this->GroupMap[key] = pbxgroup; + } } } } |