FILE_SET: Make INTERFACE libraries with HEADER_SETS participate in buildsystem

If an INTERFACE library has HEADER_SETS, and its header sets contain
files generated by a custom command, the library needs to participate in
the buildsystem so that the files will be generated.

Fixes: #23422
This commit is contained in:
Kyle Edwards
2022-04-13 10:12:35 -04:00
committed by Brad King
parent efe08e2894
commit d0d09aa29f
6 changed files with 33 additions and 2 deletions
+4 -2
View File
@@ -1208,8 +1208,10 @@ bool cmGeneratorTarget::IsInBuildSystem() const
case cmStateEnums::GLOBAL_TARGET:
return true;
case cmStateEnums::INTERFACE_LIBRARY:
// An INTERFACE library is in the build system if it has SOURCES.
if (!this->SourceEntries.empty()) {
// An INTERFACE library is in the build system if it has SOURCES or
// HEADER_SETS.
if (!this->SourceEntries.empty() ||
!this->Target->GetHeaderSetsEntries().empty()) {
return true;
}
break;