summaryrefslogtreecommitdiffstats
path: root/Source/cmGlobalXCodeGenerator.cxx
diff options
context:
space:
mode:
authorLucas SOLTIC <lucas.soltic@orange.fr>2021-09-13 22:37:48 (GMT)
committerCraig Scott <craig.scott@crascit.com>2021-09-13 22:39:22 (GMT)
commit6ef7bfbb645c9f232b41b66b8fb334da8b5ca947 (patch)
tree990531a4fefc1396549b3e09ac12145383585d41 /Source/cmGlobalXCodeGenerator.cxx
parentb7bcf70761b0008697074073b161f2569e8b46cb (diff)
downloadCMake-6ef7bfbb645c9f232b41b66b8fb334da8b5ca947.zip
CMake-6ef7bfbb645c9f232b41b66b8fb334da8b5ca947.tar.gz
CMake-6ef7bfbb645c9f232b41b66b8fb334da8b5ca947.tar.bz2
Xcode: add support for embedding dynamic libraries
Diffstat (limited to 'Source/cmGlobalXCodeGenerator.cxx')
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx7
1 files changed, 5 insertions, 2 deletions
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index fa76b01..4ccc955 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3809,7 +3809,7 @@ void cmGlobalXCodeGenerator::AddEmbeddedObjects(
copyFilesBuildPhase->AddAttribute("runOnlyForDeploymentPostprocessing",
this->CreateString("0"));
cmXCodeObject* buildFiles = this->CreateObject(cmXCodeObject::OBJECT_LIST);
- // Collect all embedded frameworks and add them to build phase
+ // Collect all embedded frameworks and dylibs and add them to build phase
std::vector<std::string> relFiles = cmExpandedList(*files);
for (std::string const& relFile : relFiles) {
cmXCodeObject* buildFile{ nullptr };
@@ -3839,7 +3839,8 @@ void cmGlobalXCodeGenerator::AddEmbeddedObjects(
} else {
buildFile = it->second;
}
- } else if (cmSystemTools::IsPathToFramework(relFile)) {
+ } else if (cmSystemTools::IsPathToFramework(relFile) ||
+ cmSystemTools::IsPathToMacOSSharedLibrary(relFile)) {
// This is a regular string path - create file reference
auto it = this->EmbeddedLibRefs.find(relFile);
if (it == this->EmbeddedLibRefs.end()) {
@@ -3905,6 +3906,8 @@ void cmGlobalXCodeGenerator::AddEmbeddedFrameworks(cmXCodeObject* target)
{
static const auto dstSubfolderSpec = "10";
+ // Despite the name, by default Xcode uses "Embed Frameworks" build phase for
+ // both frameworks and dynamic libraries
this->AddEmbeddedObjects(target, "Embed Frameworks",
"XCODE_EMBED_FRAMEWORKS", dstSubfolderSpec,
NoActionOnCopyByDefault);