Skip to content

Commit

Permalink
fix new CMakeDeps libs=[lib1, lib2] multilib expansion (#17598)
Browse files Browse the repository at this point in the history
  • Loading branch information
memsharded authored Jan 20, 2025
1 parent 12c9e80 commit ad05df3
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions conan/internal/model/cpp_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -785,20 +785,20 @@ def deduce_full_cpp_info(self, conanfile):
ConanOutput().warning(f"{conanfile}: The 'cpp_info.libs' contain more than 1 library. "
"Define 'cpp_info.components' instead.")
assert not self.components, f"{conanfile} cpp_info shouldn't have .libs and .components"
common = self._package.clone()
common.libs = []
common.type = str(PackageType.HEADER) # the type of components is a string!
result.components["_common"] = common

for lib in self.libs:
c = _Component() # Do not do a full clone, we don't need the properties
c.type = self.type # This should be a string
c.includedirs = self.includedirs
c.libdirs = self.libdirs
c.bindirs = self.bindirs
c.libs = [lib]
c.requires = ["_common"]
result.components[f"_{lib}"] = c

common = self._package.clone()
common.libs = []
common.type = str(PackageType.HEADER) # the type of components is a string!
common.requires = list(result.components.keys()) + (self.requires or [])
result.components["_common"] = common
else:
result._package = self._package.clone()
result.default_components = self.default_components
Expand Down

0 comments on commit ad05df3

Please sign in to comment.