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>2015-07-31 07:39:29 +0000
committerGravatar Damien Martin-Guillerez <dmarting@google.com>2015-08-04 09:05:56 +0000
commite5cf8a9df0dce674314c5a93aecb6c22ba607612 (patch)
tree83faaff3c1c032bc9332663f42ea0a46adbb425d /src/main/java/com/google/devtools/build/lib/rules/cpp/CppHelper.java
parent29f527c414e0fdfc74a99a958414ea9151110a38 (diff)
Remove all calls to AnalysisEnvironment.getDerivedArtifact() from the C++ rules that can be removed.
What is left: - The outputs of ExtractInclusionsAction. I think this action is shared between multiple rules that have the same generated file in srcs, so this call site is legitimate. - Creating the solib symlinks. This is not a shared action, but these need to be in the same directory so that the RPATH is not too long, so we must live with this for the time being. - FDO, which is beyond salvation. The artifacts under the FDO root don't really conform to the usual "only under the package directory" convention. -- MOS_MIGRATED_REVID=99551394
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, 7 insertions, 7 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 5250665375..45302a4794 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
@@ -297,16 +297,16 @@ public class CppHelper {
}
/**
- * Returns the workspace-relative filename for the linked artifact.
+ * Returns the linked artifact.
*/
- public static PathFragment getLinkedFilename(RuleContext ruleContext,
- LinkTargetType linkType) {
- PathFragment result =
- ruleContext.getPackageDirectory().getRelative(ruleContext.getLabel().getName());
+ public static Artifact getLinkedArtifact(RuleContext ruleContext, LinkTargetType linkType) {
+ PathFragment name = new PathFragment(ruleContext.getLabel().getName());
if (linkType != LinkTargetType.EXECUTABLE) {
- result = result.replaceName("lib" + result.getBaseName() + linkType.getExtension());
+ name = name.replaceName("lib" + name.getBaseName() + linkType.getExtension());
}
- return result;
+
+ return ruleContext.getPackageRelativeArtifact(
+ name, ruleContext.getConfiguration().getBinDirectory());
}
/**