From 7e33704e7546bb676e9052089c30f1dd625fd082 Mon Sep 17 00:00:00 2001 From: Cal Peyser Date: Thu, 11 Aug 2016 20:04:57 +0000 Subject: 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 --- .../google/devtools/build/lib/rules/cpp/CppLinkAction.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CppLinkAction.java') 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 getArgv() { return linkCommandLine.arguments(); } + + @Override + public List getArguments() { + return getArgv(); + } /** * Returns the command line specification for this link, included any required linkstamp -- cgit v1.2.3