diff options
author | Brad King <brad.king@kitware.com> | 2020-12-18 18:44:44 (GMT) |
---|---|---|
committer | Craig Scott <craig.scott@crascit.com> | 2021-02-02 23:08:48 (GMT) |
commit | 375b307bae4513b69b9f86549a094da7f2e8b3a7 (patch) | |
tree | edffc1d543ed67866cf80600c0bc3034e304514e /Source | |
parent | 0c86d15459eeef2ddd15644b7bb3d7854f226334 (diff) | |
download | CMake-375b307bae4513b69b9f86549a094da7f2e8b3a7.zip CMake-375b307bae4513b69b9f86549a094da7f2e8b3a7.tar.gz CMake-375b307bae4513b69b9f86549a094da7f2e8b3a7.tar.bz2 |
Apple: Fix linking to frameworks that do not exist until build time
Fixes: #21621
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmComputeLinkInformation.cxx | 18 | ||||
-rw-r--r-- | Source/cmComputeLinkInformation.h | 1 |
2 files changed, 6 insertions, 13 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 diff --git a/Source/cmComputeLinkInformation.h b/Source/cmComputeLinkInformation.h index 543b6d7..ec8d73c 100644 --- a/Source/cmComputeLinkInformation.h +++ b/Source/cmComputeLinkInformation.h @@ -155,7 +155,6 @@ private: void AddFullItem(BT<std::string> const& item); bool CheckImplicitDirItem(std::string const& item); void AddUserItem(BT<std::string> const& item, bool pathNotKnown); - void AddDirectoryItem(std::string const& item); void AddFrameworkItem(std::string const& item); void DropDirectoryItem(std::string const& item); bool CheckSharedLibNoSOName(std::string const& item); |