diff options
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java index 6a21ba0b9d..fc7bda0f34 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java @@ -132,14 +132,19 @@ public class CppHelper { /** * Returns the malloc implementation for the given target. */ - public static TransitiveInfoCollection mallocForTarget(RuleContext ruleContext) { + public static TransitiveInfoCollection mallocForTarget( + RuleContext ruleContext, String mallocAttrName) { if (ruleContext.getFragment(CppConfiguration.class).customMalloc() != null) { return ruleContext.getPrerequisite(":default_malloc", Mode.TARGET); } else { - return ruleContext.getPrerequisite("malloc", Mode.TARGET); + return ruleContext.getPrerequisite(mallocAttrName, Mode.TARGET); } } + public static TransitiveInfoCollection mallocForTarget(RuleContext ruleContext) { + return mallocForTarget(ruleContext, "malloc"); + } + /** * Expands Make variables in a list of string and tokenizes the result. If the package feature * no_copts_tokenization is set, tokenize only items consisting of a single make variable. |