diff options
author | 2017-03-28 17:47:10 +0000 | |
---|---|---|
committer | 2017-03-29 14:19:57 +0200 | |
commit | bb2d36accb0510493a197e2692e3c02d669ad05b (patch) | |
tree | cc01f24b9659d3d90ae0c3550a26e58149e30f1d /src/main/java/com/google | |
parent | 8c20d68f00fb2d6a4f7b34d753724246df6ad27e (diff) |
Actions arising from experimental_objc_library in opt mode do not use "-g0" if
--apple_generate_dsym is set, as in the legacy case.
PiperOrigin-RevId: 151468688
Diffstat (limited to 'src/main/java/com/google')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/objc/CrosstoolCompilationSupport.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/objc/CrosstoolCompilationSupport.java b/src/main/java/com/google/devtools/build/lib/rules/objc/CrosstoolCompilationSupport.java index 50afcd3c14..30b8d9f55f 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/objc/CrosstoolCompilationSupport.java +++ b/src/main/java/com/google/devtools/build/lib/rules/objc/CrosstoolCompilationSupport.java @@ -89,6 +89,14 @@ public class CrosstoolCompilationSupport extends CompilationSupport { * "is_not_test_target" instead of the more intuitive "is_test_target". */ private static final String IS_NOT_TEST_TARGET_FEATURE_NAME = "is_not_test_target"; + /** + * Enabled if this target does not generate debug symbols. + * + * <p>Note that the crosstool does not support feature negation in FlagSet.with_feature, which is + * the mechanism used to condition linker arguments here. Therefore, we expose + * "no_generate_debug_symbols" instead of the more intuitive "generate_debug_symbols". + */ + private static final String NO_GENERATE_DEBUG_SYMBOLS_FEATURE_NAME = "no_generate_debug_symbols"; private static final Iterable<String> ACTIVATED_ACTIONS = ImmutableList.of( @@ -416,6 +424,9 @@ public class CrosstoolCompilationSupport extends CompilationSupport { if (!TargetUtils.isTestRule(ruleContext.getRule())) { activatedCrosstoolSelectables.add(IS_NOT_TEST_TARGET_FEATURE_NAME); } + if (!configuration.getFragment(ObjcConfiguration.class).generateDsym()) { + activatedCrosstoolSelectables.add(NO_GENERATE_DEBUG_SYMBOLS_FEATURE_NAME); + } activatedCrosstoolSelectables.addAll(ruleContext.getFeatures()); return configuration |