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/cmComputeLinkInformation.cxx | |
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/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 |