aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java
diff options
context:
space:
mode:
authorGravatar Lukacs Berki <lberki@google.com>2016-09-09 15:20:49 +0000
committerGravatar Dmitry Lomov <dslomov@google.com>2016-09-12 08:54:44 +0000
commite3ed60d6e9d7fd222daeb881652ae5403e9ab550 (patch)
tree1c3d8188bbb130bee7c1ab69d0c10c63ea657d35 /src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java
parentc02dc27f388debddde0b24eaa7d4590f6979bb42 (diff)
Make cc_toolchain not croak if something that is not a shared library is mentioned in the dynamic_runtime_libs attribute.
-- MOS_MIGRATED_REVID=132676097
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java14
1 files changed, 5 insertions, 9 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 49eefe9413..f5e0ab5f39 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
@@ -457,18 +457,18 @@ public class CppHelper {
* before populating the set of files necessary to execute an action.
*/
static List<Artifact> getAggregatingMiddlemanForCppRuntimes(RuleContext ruleContext,
- String purpose, TransitiveInfoCollection dep, String solibDirOverride,
+ String purpose, Iterable<Artifact> artifacts, String solibDirOverride,
BuildConfiguration configuration) {
return getMiddlemanInternal(ruleContext, ruleContext.getActionOwner(), purpose,
- dep, true, true, solibDirOverride, configuration);
+ artifacts, true, true, solibDirOverride, configuration);
}
@VisibleForTesting
public static List<Artifact> getAggregatingMiddlemanForTesting(
- RuleContext ruleContext, ActionOwner owner, String purpose, TransitiveInfoCollection dep,
+ RuleContext ruleContext, ActionOwner owner, String purpose, Iterable<Artifact> artifacts,
boolean useSolibSymlinks, BuildConfiguration configuration) {
return getMiddlemanInternal(
- ruleContext, owner, purpose, dep, useSolibSymlinks, false, null, configuration);
+ ruleContext, owner, purpose, artifacts, useSolibSymlinks, false, null, configuration);
}
/**
@@ -476,13 +476,9 @@ public class CppHelper {
*/
private static List<Artifact> getMiddlemanInternal(
RuleContext ruleContext, ActionOwner actionOwner, String purpose,
- TransitiveInfoCollection dep, boolean useSolibSymlinks, boolean isCppRuntime,
+ Iterable<Artifact> artifacts, boolean useSolibSymlinks, boolean isCppRuntime,
String solibDirOverride, BuildConfiguration configuration) {
- if (dep == null) {
- return ImmutableList.of();
- }
MiddlemanFactory factory = ruleContext.getAnalysisEnvironment().getMiddlemanFactory();
- Iterable<Artifact> artifacts = dep.getProvider(FileProvider.class).getFilesToBuild();
if (useSolibSymlinks) {
List<Artifact> symlinkedArtifacts = new ArrayList<>();
for (Artifact artifact : artifacts) {