diff options
author | 2018-04-20 02:09:36 -0700 | |
---|---|---|
committer | 2018-04-20 02:11:08 -0700 | |
commit | dc4a3278739023cb39c66b9b017fe84d60094734 (patch) | |
tree | 5ad52d9bc7f6b1132cb4c3618931b7a3ae390dc5 /src/main/java/com/google/devtools/build/lib/rules/cpp/CppToolchainInfo.java | |
parent | eafd4d4a088cde1f4a3b36412a763ce19abe672d (diff) |
Extract CcCommon.configureFeaturesOrThrowEvalException
This method will be available to Skylark. Native rules will use the wrapped
version in CcCommon.configureFeaturesOrReportRuleError. The error message shown
in case of conflicting features was modified slightly.
RELNOTES: None.
PiperOrigin-RevId: 193639182
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppToolchainInfo.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppToolchainInfo.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppToolchainInfo.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppToolchainInfo.java index b8643ad4c5..8a977f5c7f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppToolchainInfo.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppToolchainInfo.java @@ -84,6 +84,7 @@ public final class CppToolchainInfo { private final ImmutableList<String> ldOptionsForEmbedding; private final ImmutableList<String> objCopyOptionsForEmbedding; + private final Label ccToolchainLabel; private final Label staticRuntimeLibsLabel; private final Label dynamicRuntimeLibsLabel; private final String solibDirectory; @@ -189,6 +190,7 @@ public final class CppToolchainInfo { ImmutableList.copyOf(toolchain.getTestOnlyLinkerFlagList()), ImmutableList.copyOf(toolchain.getLdEmbedFlagList()), ImmutableList.copyOf(toolchain.getObjcopyEmbedFlagList()), + toolchainLabel, toolchainLabel.getRelative( toolchain.hasStaticRuntimesFilegroup() ? toolchain.getStaticRuntimesFilegroup() @@ -208,8 +210,7 @@ public final class CppToolchainInfo { lipoCFlagsBuilder.build(), lipoCxxFlagsBuilder.build(), new FlagList( - ImmutableList.copyOf(toolchain.getUnfilteredCxxFlagList()), - ImmutableList.of()), + ImmutableList.copyOf(toolchain.getUnfilteredCxxFlagList()), ImmutableList.of()), toolchain.getSupportsFission(), toolchain.getSupportsStartEndLib(), toolchain.getSupportsEmbeddedRuntimes(), @@ -247,6 +248,7 @@ public final class CppToolchainInfo { ImmutableList<String> testOnlyLinkFlags, ImmutableList<String> ldOptionsForEmbedding, ImmutableList<String> objCopyOptionsForEmbedding, + Label ccToolchainLabel, Label staticRuntimeLibsLabel, Label dynamicRuntimeLibsLabel, String solibDirectory, @@ -291,6 +293,7 @@ public final class CppToolchainInfo { this.testOnlyLinkFlags = testOnlyLinkFlags; this.ldOptionsForEmbedding = ldOptionsForEmbedding; this.objCopyOptionsForEmbedding = objCopyOptionsForEmbedding; + this.ccToolchainLabel = ccToolchainLabel; this.staticRuntimeLibsLabel = staticRuntimeLibsLabel; this.dynamicRuntimeLibsLabel = dynamicRuntimeLibsLabel; this.solibDirectory = solibDirectory; @@ -517,6 +520,11 @@ public final class CppToolchainInfo { return getToolPathFragment(toolPaths, tool); } + /** Returns a label that references the current cc_toolchain target. */ + public Label getCcToolchainLabel() { + return ccToolchainLabel; + } + /** * Returns a label that references the library files needed to statically link the C++ runtime * (i.e. libgcc.a, libgcc_eh.a, libstdc++.a) for the target architecture. |