diff options
author | 2016-04-04 09:35:16 +0000 | |
---|---|---|
committer | 2016-04-04 14:01:31 +0000 | |
commit | 61e3fc9ac7aa7a0a907af291e97ef12f43ca9a3e (patch) | |
tree | 2568b621f1338c67a1253b31c0ba8351d6b90e7e /src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainRule.java | |
parent | 002615cd738a7d63daba06cd1fcaf1d97037f299 (diff) |
Dig out the builtin include file from the filegroup of libc_top instead of special-casing it in CppConfiguration.
This seems to be the most reasonable solution. I was toying with the idea of adding a field to CROSSTOOL but that would fail if you set libc_top to something other than what was specified in that file. If I had a infinite amount of time, I'd create a custom rule called cc_libc where libc_top would point so that this file can be referenced by an attribute, but since I don't, this seems to be workable compromise.
Also note that contrary to what you'd glean from the code, we don't actually have "compile" and "link" filegroups for libc.
--
MOS_MIGRATED_REVID=118921101
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainRule.java')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainRule.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainRule.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainRule.java index 7ab982ff17..4519103d23 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainRule.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcToolchainRule.java @@ -47,7 +47,7 @@ public final class CcToolchainRule implements RuleDefinition { return ruleClass.endsWith("cc_toolchain"); } - private static final LateBoundLabel<BuildConfiguration> LIBC_LINK = + private static final LateBoundLabel<BuildConfiguration> LIBC_TOP = new LateBoundLabel<BuildConfiguration>(CppConfiguration.class) { @Override public Label getDefault( @@ -75,7 +75,7 @@ public final class CcToolchainRule implements RuleDefinition { .add(attr("supports_param_files", BOOLEAN).value(true)) .add(attr("supports_header_parsing", BOOLEAN).value(false)) // TODO(bazel-team): Should be using the TARGET configuration. - .add(attr(":libc_link", LABEL).cfg(HOST).value(LIBC_LINK)) + .add(attr(":libc_top", LABEL).cfg(HOST).value(LIBC_TOP)) .build(); } |