minor improvements in components checks
@@ -240,6 +240,8 @@ class CppInfo(_CppInfo):
return self._configs.setdefault(config, _get_cpp_info())
def _raise_incorrect_components_definition(self, package_name, package_requires):
+ if not self.components:
+ return
# Raise if mixing components
if (self.includedirs != [DEFAULT_INCLUDE] or
self.libdirs != [DEFAULT_LIB] or
@@ -255,10 +257,10 @@ class CppInfo(_CppInfo):
self.cxxflags or
self.sharedlinkflags or
self.exelinkflags or
- self.build_modules) and self.components:
+ self.build_modules):
raise ConanException("self.cpp_info.components cannot be used with self.cpp_info "
"global values at the same time")
- if self._configs and self.components:
+ if self._configs:
raise ConanException("self.cpp_info.components cannot be used with self.cpp_info configs"
" (release/debug/...) at the same time")
@@ -268,7 +270,7 @@ class CppInfo(_CppInfo):
raise ConanException("Component name cannot be the same as the package name: '%s'"
% comp_name)
- if self.components:
+ # check that requires are used in components and check that components exists in requires
comp_requires = set()
for comp_name, comp in self.components.items():
for comp_require in comp.requires:
