aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java b/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java
index e9b795b4c1..620010edd4 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/IntermediateArtifacts.java
@@ -21,6 +21,7 @@ import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.analysis.config.BuildConfiguration;
import com.google.devtools.build.lib.cmdline.Label;
import com.google.devtools.build.lib.rules.cpp.CppCompileAction.DotdFile;
+import com.google.devtools.build.lib.rules.cpp.CppHelper;
import com.google.devtools.build.lib.rules.cpp.CppModuleMap;
import com.google.devtools.build.lib.util.Preconditions;
import com.google.devtools.build.lib.vfs.FileSystemUtils;
@@ -80,6 +81,13 @@ public final class IntermediateArtifacts {
}
/**
+ * Returns the archive file name suffix.
+ */
+ public String archiveFileNameSuffix() {
+ return archiveFileNameSuffix;
+ }
+
+ /**
* Returns the location of this target's generated entitlements file.
*/
public Artifact entitlements() {
@@ -243,7 +251,7 @@ public final class IntermediateArtifacts {
* The {@code .a} file which contains all the compiled sources for a rule.
*/
public Artifact archive() {
- // The path will be RULE_PACKAGE/libRULEBASENAME.a
+ // The path will be {RULE_PACKAGE}/lib{RULEBASENAME}{SUFFIX}.a
String basename = new PathFragment(ruleContext.getLabel().getName()).getBaseName();
return scopedArtifact(new PathFragment(String.format(
"lib%s%s.a", basename, archiveFileNameSuffix)));
@@ -263,8 +271,7 @@ public final class IntermediateArtifacts {
*/
public Artifact objFile(Artifact source) {
if (source.isTreeArtifact()) {
- PathFragment rootRelativePath = source.getRootRelativePath().replaceName("obj_files");
- return ruleContext.getTreeArtifact(rootRelativePath, ruleContext.getBinOrGenfilesDirectory());
+ return CppHelper.getCompileOutputTreeArtifact(ruleContext, source);
} else {
return inUniqueObjsDir(source, ".o");
}