diff options
author | Lukacs Berki <lberki@google.com> | 2017-02-23 12:12:26 +0000 |
---|---|---|
committer | Irina Iancu <elenairina@google.com> | 2017-02-24 08:28:14 +0000 |
commit | a068bd16d4dfa78516b85812177c1ccfec430fd1 (patch) | |
tree | 1bdeff9fd5eb8c9f488fcac494d4fd128f004dca /src | |
parent | 2346f5a01561f695a2b2ba7655359d5020105077 (diff) |
Pass in the "coverage enabled" flag on the C++ linkstamp compile command line.
--
PiperOrigin-RevId: 148329920
MOS_MIGRATED_REVID=148329920
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java index 2f5b6488d7..bb3cdbdb79 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/LinkCommandLine.java @@ -54,6 +54,7 @@ import javax.annotation.Nullable; public final class LinkCommandLine extends CommandLine { private final String actionName; private final String toolPath; + private final boolean codeCoverageEnabled; private final CppConfiguration cppConfiguration; private final ActionOwner owner; private final CcToolchainFeatures.Variables variables; @@ -101,6 +102,7 @@ public final class LinkCommandLine extends CommandLine { this.actionName = actionName; this.toolPath = toolPath; + this.codeCoverageEnabled = configuration.isCodeCoverageEnabled(); this.cppConfiguration = configuration.getFragment(CppConfiguration.class); this.variables = variables; this.featureConfiguration = featureConfiguration; @@ -572,6 +574,7 @@ public final class LinkCommandLine extends CommandLine { } optionList.add("-DGPLATFORM=\"" + cppConfiguration + "\""); + optionList.add("-DBUILD_COVERAGE_ENABLED=" + (codeCoverageEnabled ? "1" : "0")); // Needed to find headers included from linkstamps. optionList.add("-I."); |