summaryrefslogtreecommitdiffstats
path: root/Source
diff options
context:
space:
mode:
authorBen Boeckel <ben.boeckel@kitware.com>2023-07-24 19:02:21 (GMT)
committerBen Boeckel <ben.boeckel@kitware.com>2023-08-01 14:06:02 (GMT)
commite166bbef7bd8fa59c427911d96f41cd8a305af75 (patch)
tree340561c09efcf7c7f26628837b7ca15f7334d539 /Source
parent17dcd9424aefdfa10b72ad3d3bfe35e186cad02b (diff)
downloadCMake-e166bbef7bd8fa59c427911d96f41cd8a305af75.zip
CMake-e166bbef7bd8fa59c427911d96f41cd8a305af75.tar.gz
CMake-e166bbef7bd8fa59c427911d96f41cd8a305af75.tar.bz2
cmComputeLinkInformation: prepare Item consumers for `OBJECT` libraries
After b665966933 (cmComputeLinkInformation: track `OBJECT` library dependencies, 2023-07-22), introduced in !8645 as a fix for #25112, `OBJECT` libraries were tracked in a separate member to reduce the risk of further regressions. This commit prepares consumers to handle `OBJECT` libraries once they start appearing as link items.
Diffstat (limited to 'Source')
-rw-r--r--Source/cmExportFileGenerator.cxx2
-rw-r--r--Source/cmGeneratorTarget.cxx2
-rw-r--r--Source/cmGlobalXCodeGenerator.cxx7
-rw-r--r--Source/cmLinkLineComputer.cxx3
-rw-r--r--Source/cmLinkLineDeviceComputer.cxx1
-rw-r--r--Source/cmLocalVisualStudio7Generator.cxx3
-rw-r--r--Source/cmVisualStudio10TargetGenerator.cxx3
7 files changed, 16 insertions, 5 deletions
diff --git a/Source/cmExportFileGenerator.cxx b/Source/cmExportFileGenerator.cxx
index 481c98f..41234f4 100644
--- a/Source/cmExportFileGenerator.cxx
+++ b/Source/cmExportFileGenerator.cxx
@@ -536,7 +536,7 @@ static void getCompatibleInterfaceProperties(
const cmComputeLinkInformation::ItemVector& deps = info->GetItems();
for (auto const& dep : deps) {
- if (!dep.Target) {
+ if (!dep.Target || dep.Target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
continue;
}
getPropertyContents(dep.Target, "COMPATIBLE_INTERFACE_BOOL",
diff --git a/Source/cmGeneratorTarget.cxx b/Source/cmGeneratorTarget.cxx
index 3be3697..8f1818d 100644
--- a/Source/cmGeneratorTarget.cxx
+++ b/Source/cmGeneratorTarget.cxx
@@ -5858,7 +5858,7 @@ void cmGeneratorTarget::CheckPropertyCompatibility(
static const std::string strNumMax = "COMPATIBLE_INTERFACE_NUMBER_MAX";
for (auto const& dep : deps) {
- if (!dep.Target) {
+ if (!dep.Target || dep.Target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
continue;
}
diff --git a/Source/cmGlobalXCodeGenerator.cxx b/Source/cmGlobalXCodeGenerator.cxx
index da9d6ce..9834b64 100644
--- a/Source/cmGlobalXCodeGenerator.cxx
+++ b/Source/cmGlobalXCodeGenerator.cxx
@@ -3598,6 +3598,13 @@ void cmGlobalXCodeGenerator::AddDependAndLinkInformation(cmXCodeObject* target)
continue;
}
for (auto const& libItem : cli->GetItems()) {
+ // Explicitly ignore OBJECT libraries as Xcode emulates them as static
+ // libraries without an artifact. Avoid exposing this to the rest of
+ // CMake's compilation model.
+ if (libItem.Target &&
+ libItem.Target->GetType() == cmStateEnums::OBJECT_LIBRARY) {
+ continue;
+ }
// We want to put only static libraries, dynamic libraries, frameworks
// and bundles that are built from targets that are not imported in "Link
// Binary With Libraries" build phase. Except if the target property
diff --git a/Source/cmLinkLineComputer.cxx b/Source/cmLinkLineComputer.cxx
index b7ee4fa..1f5005b 100644
--- a/Source/cmLinkLineComputer.cxx
+++ b/Source/cmLinkLineComputer.cxx
@@ -65,7 +65,8 @@ void cmLinkLineComputer::ComputeLinkLibs(
ItemVector const& items = cli.GetItems();
for (auto const& item : items) {
if (item.Target &&
- item.Target->GetType() == cmStateEnums::INTERFACE_LIBRARY) {
+ (item.Target->GetType() == cmStateEnums::INTERFACE_LIBRARY ||
+ item.Target->GetType() == cmStateEnums::OBJECT_LIBRARY)) {
continue;
}
diff --git a/Source/cmLinkLineDeviceComputer.cxx b/Source/cmLinkLineDeviceComputer.cxx
index b06dc3d..ded6466 100644
--- a/Source/cmLinkLineDeviceComputer.cxx
+++ b/Source/cmLinkLineDeviceComputer.cxx
@@ -115,6 +115,7 @@ void cmLinkLineDeviceComputer::ComputeLinkLibraries(
switch (item.Target->GetType()) {
case cmStateEnums::SHARED_LIBRARY:
case cmStateEnums::MODULE_LIBRARY:
+ case cmStateEnums::OBJECT_LIBRARY:
case cmStateEnums::INTERFACE_LIBRARY:
skip = true;
break;
diff --git a/Source/cmLocalVisualStudio7Generator.cxx b/Source/cmLocalVisualStudio7Generator.cxx
index ef8a7e2..7b02c56 100644
--- a/Source/cmLocalVisualStudio7Generator.cxx
+++ b/Source/cmLocalVisualStudio7Generator.cxx
@@ -1318,7 +1318,8 @@ void cmLocalVisualStudio7GeneratorInternals::OutputLibraries(
fout << (lib.HasFeature() ? lib.GetFormattedItem(rel).Value : rel)
<< " ";
} else if (!lib.Target ||
- lib.Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
+ (lib.Target->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
+ lib.Target->GetType() != cmStateEnums::OBJECT_LIBRARY)) {
fout << lib.Value.Value << " ";
}
}
diff --git a/Source/cmVisualStudio10TargetGenerator.cxx b/Source/cmVisualStudio10TargetGenerator.cxx
index f930223..1559420 100644
--- a/Source/cmVisualStudio10TargetGenerator.cxx
+++ b/Source/cmVisualStudio10TargetGenerator.cxx
@@ -4603,7 +4603,8 @@ void cmVisualStudio10TargetGenerator::AddLibraries(
: path);
}
} else if (!l.Target ||
- l.Target->GetType() != cmStateEnums::INTERFACE_LIBRARY) {
+ (l.Target->GetType() != cmStateEnums::INTERFACE_LIBRARY &&
+ l.Target->GetType() != cmStateEnums::OBJECT_LIBRARY)) {
libVec.push_back(l.Value.Value);
}
}