aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java
diff options
context:
space:
mode:
authorGravatar Cal Peyser <cpeyser@google.com>2016-08-11 20:04:57 +0000
committerGravatar Yue Gan <yueg@google.com>2016-08-12 08:52:51 +0000
commit7e33704e7546bb676e9052089c30f1dd625fd082 (patch)
treea078ba5aed70f69ccbbb6d0ea42453737ebcdd5d /src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java
parent2427f8d056d143fd3ef3f8b36ffb56cf498d64bc (diff)
Implement objc archiving in the crosstool. This involves a few steps:
1) In ExperimentalObjcLibrary, if static linking is required, signal CcLibraryHelper to create a static link action and pass in the necessary variables/link action input. 2) Add a new link type (Link.LinkTargetType.OBJC_STATIC_LIBRARY). This involves changes to Link and LinkCommandLine. 3) For this new link type, implement static linking the OSX CROSSTOOL. Also add tools in the crosstool package that point at libtool, which performs the archiving. -- MOS_MIGRATED_REVID=130022410
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java
index 1a2de41530..af2e1eebb4 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java
@@ -27,6 +27,7 @@ import com.google.devtools.build.lib.actions.ActionExecutionContext;
import com.google.devtools.build.lib.actions.ActionExecutionException;
import com.google.devtools.build.lib.actions.ActionOwner;
import com.google.devtools.build.lib.actions.Artifact;
+import com.google.devtools.build.lib.actions.CommandAction;
import com.google.devtools.build.lib.actions.ExecException;
import com.google.devtools.build.lib.actions.Executor;
import com.google.devtools.build.lib.actions.ResourceSet;
@@ -56,11 +57,12 @@ import java.util.List;
import java.util.Map;
import javax.annotation.Nullable;
-/**
- * Action that represents a linking step.
+/**
+ * Action that represents a linking step.
*/
@ThreadCompatible
-public final class CppLinkAction extends AbstractAction implements ExecutionInfoSpecifier {
+public final class CppLinkAction extends AbstractAction
+ implements ExecutionInfoSpecifier, CommandAction {
/**
* An abstraction for creating intermediate and output artifacts for C++ linking.
*
@@ -255,6 +257,11 @@ public final class CppLinkAction extends AbstractAction implements ExecutionInfo
public List<String> getArgv() {
return linkCommandLine.arguments();
}
+
+ @Override
+ public List<String> getArguments() {
+ return getArgv();
+ }
/**
* Returns the command line specification for this link, included any required linkstamp