summaryrefslogtreecommitdiffstats
path: root/Source/cmComputeLinkInformation.cxx
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2020-12-18 18:44:44 (GMT)
committerBrad King <brad.king@kitware.com>2020-12-21 16:50:54 (GMT)
commit9ab77201f772af9f8f0954722ed3a2414eb1d29c (patch)
tree6b3142e4c59ba1254c8ab28d2c633e52650bd649 /Source/cmComputeLinkInformation.cxx
parent05a59f37abd982b249f8cad648640c3394acc98a (diff)
downloadCMake-9ab77201f772af9f8f0954722ed3a2414eb1d29c.zip
CMake-9ab77201f772af9f8f0954722ed3a2414eb1d29c.tar.gz
CMake-9ab77201f772af9f8f0954722ed3a2414eb1d29c.tar.bz2
Apple: Fix linking to frameworks that do not exist until build time
Fixes: #21621
Diffstat (limited to 'Source/cmComputeLinkInformation.cxx')
-rw-r--r--Source/cmComputeLinkInformation.cxx18
1 files changed, 6 insertions, 12 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index 201a9d9..6e1fac0 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -699,9 +699,13 @@ void cmComputeLinkInformation::AddItem(BT<std::string> const& item,
} else {
// This is not a CMake target. Use the name given.
if (cmSystemTools::FileIsFullPath(item.Value)) {
- if (cmSystemTools::FileIsDirectory(item.Value)) {
+ if (cmSystemTools::IsPathToFramework(item.Value) &&
+ this->Makefile->IsOn("APPLE")) {
+ // This is a framework.
+ this->AddFrameworkItem(item.Value);
+ } else if (cmSystemTools::FileIsDirectory(item.Value)) {
// This is a directory.
- this->AddDirectoryItem(item.Value);
+ this->DropDirectoryItem(item.Value);
} else {
// Use the full path given to the library file.
this->Depends.push_back(item.Value);
@@ -1306,16 +1310,6 @@ void cmComputeLinkInformation::AddFrameworkItem(std::string const& item)
}
}
-void cmComputeLinkInformation::AddDirectoryItem(std::string const& item)
-{
- if (this->Makefile->IsOn("APPLE") &&
- cmSystemTools::IsPathToFramework(item)) {
- this->AddFrameworkItem(item);
- } else {
- this->DropDirectoryItem(item);
- }
-}
-
void cmComputeLinkInformation::DropDirectoryItem(std::string const& item)
{
// A full path to a directory was found as a link item. Warn the