From 6e162b54f708d7957c04d8dffce367fbeaa1a366 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Tue, 24 Jan 2017 11:18:16 -0800 Subject: 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 --- BUILD.gn | 19 ++++++++++--------- samples/BUILD.gn | 10 ++++++++++ 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/BUILD.gn b/BUILD.gn index b41c1cdb07..c7266d3a1d 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -7,6 +7,7 @@ import("pdfium.gni") config("pdfium_common_config") { cflags = [] + ldflags = [] include_dirs = [ ".", "third_party/freetype/include", @@ -37,11 +38,19 @@ config("pdfium_common_config") { if (pdf_use_win32_gdi) { defines += [ "PDFIUM_PRINT_TEXT_WITH_GDI" ] } + + if (use_coverage && is_clang) { + cflags += [ + "--coverage", + "-g", + "-O0", + ] + ldflags += [ "--coverage" ] + } } config("pdfium_core_config") { cflags = [] - ldflags = [] configs = [ ":pdfium_common_config" ] defines = [ "V8_DEPRECATION_WARNINGS" ] if (is_linux) { @@ -55,14 +64,6 @@ config("pdfium_core_config") { if (is_win) { cflags += [ "/wd4267" ] } - if (use_coverage && is_clang) { - cflags += [ - "--coverage", - "-g", - "-O0", - ] - ldflags += [ "--coverage" ] - } } config("xfa_warnings") { diff --git a/samples/BUILD.gn b/samples/BUILD.gn index b4baf2b889..11bc9bab38 100644 --- a/samples/BUILD.gn +++ b/samples/BUILD.gn @@ -14,6 +14,8 @@ group("samples") { } config("pdfium_samples_config") { + cflags = [] + ldflags = [] defines = [ "PNG_PREFIX", "PNG_USE_READ_MACROS", @@ -28,6 +30,14 @@ config("pdfium_samples_config") { if (pdf_use_skia) { defines += [ "PDF_ENABLE_SKIA" ] } + if (use_coverage && is_clang) { + cflags += [ + "--coverage", + "-g", + "-O0", + ] + ldflags += [ "--coverage" ] + } } executable("pdfium_test") { -- cgit v1.2.3