use of com.google.devtools.build.lib.rules.cpp.CcLinkParams.Linkstamp in project bazel by bazelbuild.
the class CppHelper method resolveLinkstamps.
/**
* Resolves the linkstamp collection from the {@code CcLinkParams} into a map.
*
* <p>Emits a warning on the rule if there are identical linkstamp artifacts with different
* compilation contexts.
*/
public static Map<Artifact, NestedSet<Artifact>> resolveLinkstamps(RuleErrorConsumer listener, CcLinkParams linkParams) {
Map<Artifact, NestedSet<Artifact>> result = new LinkedHashMap<>();
for (Linkstamp pair : linkParams.getLinkstamps()) {
Artifact artifact = pair.getArtifact();
if (result.containsKey(artifact)) {
listener.ruleWarning("rule inherits the '" + artifact.toDetailString() + "' linkstamp file from more than one cc_library rule");
}
result.put(artifact, pair.getDeclaredIncludeSrcs());
}
return result;
}
Aggregations