C++: Same CcCompilationOutputs used for Java and C++.
When linking a cc_binary we do not process the direct hdrs of the cc_binary
rule. We shouldn't propagate these through CcLauncherInfo in order to be
consistent.
RELNOTES:none
@@ -379,7 +379,8 @@ public abstract class CcBinary implements RuleConfiguredTargetFactory {
pdbFile = ruleContext.getRelatedArtifact(binary.getRootRelativePath(), ".pdb");
}
- Pair<CcLinkingOutputs, CcLinkingInfo> ccLinkingOutputsAndCcLinkingInfo =
+ Pair<CcLinkingOutputs, Pair<CcLinkingInfo, CcCompilationOutputs>>
+ ccLinkingOutputsAndCcLinkingInfo =
createTransitiveLinkingActions(
ruleContext,
ccToolchain,
@@ -406,8 +407,8 @@ public abstract class CcBinary implements RuleConfiguredTargetFactory {
CcLauncherInfo ccLauncherInfo =
new CcLauncherInfo(
- ccLinkingOutputsAndCcLinkingInfo.second.getStaticModeParamsForExecutable(),
- ccCompilationOutputs);
+ ccLinkingOutputsAndCcLinkingInfo.second.first.getStaticModeParamsForExecutable(),
+ ccLinkingOutputsAndCcLinkingInfo.second.second);
// Store immutable context for use in other *_binary rules that are implemented by
// linking the interpreter (Java, Python, etc.) together with native deps.
@@ -553,7 +554,8 @@ public abstract class CcBinary implements RuleConfiguredTargetFactory {
.build();
}
- public static Pair<CcLinkingOutputs, CcLinkingInfo> createTransitiveLinkingActions(
+ public static Pair<CcLinkingOutputs, Pair<CcLinkingInfo, CcCompilationOutputs>>
+ createTransitiveLinkingActions(
RuleContext ruleContext,
CcToolchainProvider ccToolchain,
FeatureConfiguration featureConfiguration,
@@ -669,7 +671,8 @@ public abstract class CcBinary implements RuleConfiguredTargetFactory {
}
return Pair.of(
- ccLinkingHelper.link(ccCompilationOutputsWithOnlyObjects), ccLinkingInfo.build());
+ ccLinkingHelper.link(ccCompilationOutputsWithOnlyObjects),
+ Pair.of(ccLinkingInfo.build(), ccCompilationOutputsWithOnlyObjects));
}
/**
