aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java')
-rw-r--r--src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java
index e5f0191a3a..30d0949419 100644
--- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java
+++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcCompilationHelper.java
@@ -231,6 +231,7 @@ public final class CcCompilationHelper {
private String purpose = null;
private boolean generateNoPicAction;
private boolean generatePicAction;
+ private boolean allowCoverageInstrumentation = true;
// TODO(plf): Pull out of class.
private CcCompilationContext ccCompilationContext;
@@ -710,6 +711,10 @@ public final class CcCompilationHelper {
return this;
}
+ public void setAllowCoverageInstrumentation(boolean allowCoverageInstrumentation) {
+ this.allowCoverageInstrumentation = allowCoverageInstrumentation;
+ }
+
/**
* Create the C++ compile actions, and the corresponding compilation related providers.
*
@@ -1935,7 +1940,10 @@ public final class CcCompilationHelper {
}
/** Returns true iff code coverage is enabled for the given target. */
- private boolean isCodeCoverageEnabled() {
+ public boolean isCodeCoverageEnabled() {
+ if (!allowCoverageInstrumentation) {
+ return false;
+ }
if (configuration.isCodeCoverageEnabled()) {
// If rule is matched by the instrumentation filter, enable instrumentation
if (InstrumentedFilesCollector.shouldIncludeLocalSources(ruleContext)) {