summaryrefslogtreecommitdiffstats
path: root/Source/cmTarget.cxx
diff options
context:
space:
mode:
authorKyle Edwards <kyle.edwards@kitware.com>2023-05-17 17:50:32 (GMT)
committerKyle Edwards <kyle.edwards@kitware.com>2023-07-26 21:00:01 (GMT)
commit7050ac56a11768c90f55654aa3f63d02bb549243 (patch)
treea436ee5be767bfd776dc93d747abd122a94f3a34 /Source/cmTarget.cxx
parent93ed53790cb1e2d5f25f26156ee5c6590b0d3150 (diff)
downloadCMake-7050ac56a11768c90f55654aa3f63d02bb549243.zip
CMake-7050ac56a11768c90f55654aa3f63d02bb549243.tar.gz
CMake-7050ac56a11768c90f55654aa3f63d02bb549243.tar.bz2
macOS: Add support for linking against .xcframework folders
Issue: #21752
Diffstat (limited to 'Source/cmTarget.cxx')
-rw-r--r--Source/cmTarget.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/Source/cmTarget.cxx b/Source/cmTarget.cxx
index 1281bc6..76a14b8 100644
--- a/Source/cmTarget.cxx
+++ b/Source/cmTarget.cxx
@@ -40,6 +40,7 @@
#include "cmSystemTools.h"
#include "cmTargetPropertyComputer.h"
#include "cmValue.h"
+#include "cmXcFramework.h"
#include "cmake.h"
template <>
@@ -2800,6 +2801,25 @@ std::string cmTarget::ImportedGetFullPath(
}
}
}
+ if (this->IsApple() &&
+ (this->impl->TargetType == cmStateEnums::SHARED_LIBRARY ||
+ this->impl->TargetType == cmStateEnums::STATIC_LIBRARY ||
+ this->impl->TargetType == cmStateEnums::UNKNOWN_LIBRARY) &&
+ cmSystemTools::IsPathToXcFramework(result)) {
+ auto plist = cmParseXcFrameworkPlist(result, *this->impl->Makefile,
+ this->impl->Backtrace);
+ if (!plist) {
+ return "";
+ }
+ auto const* library = plist->SelectSuitableLibrary(
+ *this->impl->Makefile, this->impl->Backtrace);
+ if (library) {
+ result = cmStrCat(result, '/', library->LibraryIdentifier, '/',
+ library->LibraryPath);
+ } else {
+ return "";
+ }
+ }
break;
case cmStateEnums::ImportLibraryArtifact: