aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main
diff options
context:
space:
mode:
authorGravatar bbaren <bbaren@google.com>2018-07-02 13:11:49 -0700
committerGravatar Copybara-Service <copybara-piper@google.com>2018-07-02 13:13:08 -0700
commiteb952d08f76afa907bb34eaf7e1a69899102c523 (patch)
tree22be39bdf237bfd07783854cf451ec6fabd7dd66 /src/main
parent151717ce36ad3fa99b5aaf79328f632ebd4b0f7c (diff)
Set Xcode version as a feature when building Objective-C
Add a new standard feature set to the Xcode version being used for compilation. (The feature is named `xcode_VERSION`, where `VERSION` is at least a two-component version number; `xcode_9.0` and `xcode_9.2` are both possible values.) This provides CROSSTOOL authors a mechanism to deploy compiler flags supported only in certain Xcode versions. PiperOrigin-RevId: 203000420
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java
index f6b6052895..ed95544092 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/objc/CompilationSupport.java
@@ -223,6 +223,8 @@ public class CompilationSupport {
private static final String GENERATE_LINKMAP_FEATURE_NAME = "generate_linkmap";
+ private static final String XCODE_VERSION_FEATURE_NAME_PREFIX = "xcode_";
+
/** Enabled if this target has objc sources in its transitive closure. */
private static final String CONTAINS_OBJC = "contains_objc_sources";
@@ -545,6 +547,9 @@ public class CompilationSupport {
activatedCrosstoolSelectables.add(CppRuleClasses.PER_OBJECT_DEBUG_INFO);
}
+ activatedCrosstoolSelectables.add(XCODE_VERSION_FEATURE_NAME_PREFIX
+ + XcodeConfig.getXcodeVersion(ruleContext).toStringWithMinimumComponents(2));
+
activatedCrosstoolSelectables.addAll(ruleContext.getFeatures());
activatedCrosstoolSelectables.addAll(CcCommon.getCoverageFeatures(toolchain));