diff options
Diffstat (limited to 'src/main/java/com/google/devtools/build')
3 files changed, 11 insertions, 13 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java index 5468a1607e..a8e6233d02 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppConfiguration.java @@ -2141,6 +2141,11 @@ public class CppConfiguration extends BuildConfiguration.Fragment { } if (ruleContext.getConfiguration().isCodeCoverageEnabled()) { requestedFeatures.add(CppRuleClasses.COVERAGE); + if (useLLVMCoverageMap) { + requestedFeatures.add(CppRuleClasses.LLVM_COVERAGE_MAP_FORMAT); + } else { + requestedFeatures.add(CppRuleClasses.GCC_COVERAGE_MAP_FORMAT); + } } return requestedFeatures.build(); } diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java index 1e6e1b7fb8..4ad604ed55 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppRuleClasses.java @@ -330,6 +330,12 @@ public class CppRuleClasses { */ public static final String COVERAGE = "coverage"; + /** Produce artifacts for coverage in llvm coverage mapping format. */ + public static final String LLVM_COVERAGE_MAP_FORMAT = "llvm_coverage_map_format"; + + /** Produce artifacts for coverage in gcc coverage mapping format. */ + public static final String GCC_COVERAGE_MAP_FORMAT = "gcc_coverage_map_format"; + /** A string constant for the match-clif feature. */ public static final String MATCH_CLIF = "match_clif"; } 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 aca7f7a4a1..d26eec9dbf 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 @@ -82,11 +82,6 @@ public class CrosstoolCompilationSupport extends CompilationSupport { private static final String OBJC_MODULE_FEATURE_NAME = "use_objc_modules"; private static final String NO_ENABLE_MODULES_FEATURE_NAME = "no_enable_modules"; private static final String DEAD_STRIP_FEATURE_NAME = "dead_strip"; - private static final String RUN_COVERAGE_FEATURE_NAME = "run_coverage"; - /** Produce artifacts for coverage in llvm coverage mapping format. */ - private static final String LLVM_COVERAGE_MAP_FORMAT = "llvm_coverage_map_format"; - /** Produce artifacts for coverage in gcc coverage mapping format. */ - private static final String GCC_COVERAGE_MAP_FORMAT = "gcc_coverage_map_format"; /** * Enabled if this target's rule is not a test rule. Binary stripping should not be applied in * the link step. TODO(b/36562173): Replace this behavior with a condition on bundle creation. @@ -483,14 +478,6 @@ public class CrosstoolCompilationSupport extends CompilationSupport { && ruleContext.getPrerequisiteArtifact("pch", Mode.TARGET) != null) { activatedCrosstoolSelectables.add("pch"); } - if (configuration.isCodeCoverageEnabled()) { - activatedCrosstoolSelectables.add(RUN_COVERAGE_FEATURE_NAME); - } - if (configuration.isLLVMCoverageMapFormatEnabled()) { - activatedCrosstoolSelectables.add(LLVM_COVERAGE_MAP_FORMAT); - } else { - activatedCrosstoolSelectables.add(GCC_COVERAGE_MAP_FORMAT); - } if (!isTestRule) { activatedCrosstoolSelectables.add(IS_NOT_TEST_TARGET_FEATURE_NAME); } |