Allow starlark-generated CcCompilationContext to work with include scanning
We need to add headers to HeaderInfo via addModularHdrs, else include
scanning won't be able to find any generated headers.
RELNOTES: None
@@ -602,8 +602,9 @@ public abstract class CcModule
CcCompilationContext.Builder ccCompilationContext =
CcCompilationContext.builder(
/* actionConstructionContext= */ null, /* configuration= */ null, /* label= */ null);
- ccCompilationContext.addDeclaredIncludeSrcs(
- toNestedSetOfArtifacts(headers, "headers").toList());
+ ImmutableList<Artifact> headerList = toNestedSetOfArtifacts(headers, "headers").toList();
+ ccCompilationContext.addDeclaredIncludeSrcs(headerList);
+ ccCompilationContext.addModularHdrs(headerList);
ccCompilationContext.addSystemIncludeDirs(
toNestedSetOfStrings(systemIncludes, "system_includes").toList().stream()
.map(x -> PathFragment.create(x))
