summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorMarc Chevrier <marc.chevrier@gmail.com>2022-03-27 14:08:11 (GMT)
committerMarc Chevrier <marc.chevrier@gmail.com>2022-03-29 11:57:11 (GMT)
commit45ac71d8bcb9c6bc0238a1a772029170cbf354dc (patch)
tree7ee6cda1a275f8a13345efbec20e129623daebac /Source
parent2a88b807ce96cd783795f6813a5789e2617175ec (diff)
downloadCMake-45ac71d8bcb9c6bc0238a1a772029170cbf354dc.zip
CMake-45ac71d8bcb9c6bc0238a1a772029170cbf354dc.tar.gz
CMake-45ac71d8bcb9c6bc0238a1a772029170cbf354dc.tar.bz2
Ensure targets which are frameworks can be used freely
Ensure flag -F/path/to/framework is specified during compilation step of consumers of the framework. Fixes: #23336
Diffstat (limited to 'Source')
-rw-r--r--Source/cmComputeLinkInformation.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/Source/cmComputeLinkInformation.cxx b/Source/cmComputeLinkInformation.cxx
index a1ffc82..e156e3d 100644
--- a/Source/cmComputeLinkInformation.cxx
+++ b/Source/cmComputeLinkInformation.cxx
@@ -1555,8 +1555,7 @@ void cmComputeLinkInformation::AddTargetItem(LinkEntry const& entry)
this->AddLibraryFeature("FRAMEWORK");
}
- if (cmHasSuffix(entry.Feature, "FRAMEWORK"_s) &&
- target->IsFrameworkOnApple() && !this->GlobalGenerator->IsXcode()) {
+ if (target->IsFrameworkOnApple() && !this->GlobalGenerator->IsXcode()) {
// Add the framework directory and the framework item itself
auto fwItems = this->GlobalGenerator->SplitFrameworkPath(item.Value, true);
if (!fwItems) {
@@ -1571,8 +1570,15 @@ void cmComputeLinkInformation::AddTargetItem(LinkEntry const& entry)
// Add the directory portion to the framework search path.
this->AddFrameworkPath(fwItems->first);
}
- this->Items.emplace_back(fwItems->second, ItemIsPath::Yes, target,
- this->FindLibraryFeature(entry.Feature));
+ if (cmHasSuffix(entry.Feature, "FRAMEWORK"_s)) {
+ this->Items.emplace_back(fwItems->second, ItemIsPath::Yes, target,
+ this->FindLibraryFeature(entry.Feature));
+ } else {
+ this->Items.emplace_back(
+ item, ItemIsPath::Yes, target,
+ this->FindLibraryFeature(
+ entry.Feature == DEFAULT ? "__CMAKE_LINK_LIBRARY" : entry.Feature));
+ }
} else {
// Now add the full path to the library.
this->Items.emplace_back(