Fixup coverage build
The original coverage CL made the unittests build correclty with coverage but
the code in samples/ builds differently. This CL fixes coverage for pdfium_diff
and pdfium_test code.
Review-Url: https://codereview.chromium.org/2649403003
diff --git a/samples/BUILD.gn b/samples/BUILD.gn
index b4baf2b..11bc9ba 100644
--- a/samples/BUILD.gn
+++ b/samples/BUILD.gn
@@ -14,6 +14,8 @@
}
config("pdfium_samples_config") {
+ cflags = []
+ ldflags = []
defines = [
"PNG_PREFIX",
"PNG_USE_READ_MACROS",
@@ -28,6 +30,14 @@
if (pdf_use_skia) {
defines += [ "PDF_ENABLE_SKIA" ]
}
+ if (use_coverage && is_clang) {
+ cflags += [
+ "--coverage",
+ "-g",
+ "-O0",
+ ]
+ ldflags += [ "--coverage" ]
+ }
}
executable("pdfium_test") {