diff options
author | Brad King <brad.king@kitware.com> | 2020-12-18 18:44:44 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2020-12-21 16:50:54 (GMT) |
commit | 9ab77201f772af9f8f0954722ed3a2414eb1d29c (patch) | |
tree | 6b3142e4c59ba1254c8ab28d2c633e52650bd649 /Source/cmComputeLinkInformation.cxx | |
parent | 05a59f37abd982b249f8cad648640c3394acc98a (diff) | |
download | CMake-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.cxx | 18 |
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 |