aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java
diff options
context:
space:
mode:
authorGravatar Cal Peyser <cpeyser@google.com>2017-01-18 20:07:09 +0000
committerGravatar Vladimir Moskva <vladmos@google.com>2017-01-19 12:36:38 +0000
commit7a58fdc827434ce1b872c17cda1b0a0220842387 (patch)
treec102d493d9c6f4d55782801c57c398f7355a2424 /src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java
parent8063f294bd425d71a12f5651517fe83e866c94aa (diff)
Introduce --experimental_objc_crosstool, which replaces
--experimental_objc_library and --experimental_objc_use_crosstool_for_binary. This flag will allow testing of the complete (compilation and linking) rollout of the objc crosstool. -- PiperOrigin-RevId: 144864301 MOS_MIGRATED_REVID=144864301
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java
index c774887f0b..efcbe30443 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/ObjcLibrary.java
@@ -23,6 +23,7 @@ import com.google.devtools.build.lib.analysis.RuleContext;
import com.google.devtools.build.lib.collect.nestedset.NestedSetBuilder;
import com.google.devtools.build.lib.rules.RuleConfiguredTargetFactory;
import com.google.devtools.build.lib.rules.cpp.CcLinkParamsProvider;
+import com.google.devtools.build.lib.rules.objc.ObjcCommandLineOptions.ObjcCrosstoolMode;
import com.google.devtools.build.lib.rules.objc.ObjcCommon.ResourceAttributes;
import com.google.devtools.build.lib.rules.test.InstrumentedFilesProvider;
import com.google.devtools.build.lib.syntax.Type;
@@ -58,7 +59,10 @@ public class ObjcLibrary implements RuleConfiguredTargetFactory {
public ConfiguredTarget create(RuleContext ruleContext)
throws InterruptedException, RuleErrorException {
// Support treating objc_library as experimental_objc_library
- if (ruleContext.getFragment(ObjcConfiguration.class).useExperimentalObjcLibrary()) {
+ // TODO(b/34260565): Deprecate ExperimentalObjcLibrary in favor of ObjcLibrary with
+ // CrosstoolCompilationSupport.
+ if (ruleContext.getFragment(ObjcConfiguration.class).getObjcCrosstoolMode()
+ != ObjcCrosstoolMode.OFF) {
return ExperimentalObjcLibrary.configureExperimentalObjcLibrary(ruleContext);
}
@@ -69,7 +73,7 @@ public class ObjcLibrary implements RuleConfiguredTargetFactory {
.addAll(common.getCompiledArchive().asSet());
CompilationSupport compilationSupport =
- new LegacyCompilationSupport(ruleContext)
+ CompilationSupport.create(ruleContext)
.registerCompileAndArchiveActions(common)
.registerFullyLinkAction(common.getObjcProvider(),
ruleContext.getImplicitOutputArtifact(CompilationSupport.FULLY_LINKED_LIB))