aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/CcIncLibrary.java
diff options
context:
space:
mode:
authorGravatar hlopko <hlopko@google.com>2017-05-22 11:33:47 +0200
committerGravatar Irina Iancu <elenairina@google.com>2017-05-22 14:40:28 +0200
commitb36774ac955c5af15d59df36c66dc69f89674a49 (patch)
tree4c74e6d5fdc77c511dff5708177bdfe42eeb57c0 /src/main/java/com/google/devtools/build/lib/rules/cpp/CcIncLibrary.java
parentbbb9bbc84a826345f118b0d94f337165a341af30 (diff)
Extract :cc_toolchain as constant
And while at it cleanup all the calls of CppHelper.getToolchain and CppHelper.getFdoSupport. RELNOTES: None. PiperOrigin-RevId: 156716291
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CcIncLibrary.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CcIncLibrary.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcIncLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcIncLibrary.java
index e3b9b85354..0aac22bd6a 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcIncLibrary.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcIncLibrary.java
@@ -59,7 +59,8 @@ public abstract class CcIncLibrary implements RuleConfiguredTargetFactory {
@Override
public ConfiguredTarget create(final RuleContext ruleContext)
throws RuleErrorException, InterruptedException {
- CcToolchainProvider ccToolchain = CppHelper.getToolchain(ruleContext, ":cc_toolchain");
+ CcToolchainProvider ccToolchain =
+ CppHelper.getToolchainUsingDefaultCcToolchainAttribute(ruleContext);
FeatureConfiguration featureConfiguration =
CcCommon.configureFeatures(ruleContext, ccToolchain);
PathFragment packageFragment = ruleContext.getPackageDirectory();
@@ -126,7 +127,8 @@ public abstract class CcIncLibrary implements RuleConfiguredTargetFactory {
ImmutableSortedMap<Artifact, Artifact> virtualArtifactMap = virtualArtifactMapBuilder.build();
ruleContext.registerAction(
new CreateIncSymlinkAction(ruleContext.getActionOwner(), virtualArtifactMap, includeRoot));
- FdoSupportProvider fdoSupport = CppHelper.getFdoSupport(ruleContext, ":cc_toolchain");
+ FdoSupportProvider fdoSupport =
+ CppHelper.getFdoSupportUsingDefaultCcToolchainAttribute(ruleContext);
CcLibraryHelper.Info info =
new CcLibraryHelper(ruleContext, semantics, featureConfiguration, ccToolchain, fdoSupport)
.addIncludeDirs(Arrays.asList(includePath))