| # Copyright 2014 The Chromium Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/buildflag_header.gni") |
| import("//build/config/features.gni") |
| import("//build/config/jumbo.gni") |
| import("//pdf/features.gni") |
| import("//testing/test.gni") |
| import("//third_party/pdfium/pdfium.gni") |
| |
| # Generate a buildflag header for compile-time checking of PDF support. |
| buildflag_header("features") { |
| header = "features.h" |
| flags = [ "ENABLE_PDF=$enable_pdf" ] |
| } |
| |
| if (enable_pdf) { |
| pdf_engine = 0 # 0 PDFium |
| |
| jumbo_component("pdf") { |
| deps = [ |
| "//base", |
| "//base:i18n", |
| "//gin", |
| "//net", |
| "//ppapi/cpp:objects", |
| "//ppapi/cpp/private:internal_module", |
| "//ui/base", |
| "//ui/gfx/range", |
| ] |
| |
| public = [ |
| "pdf.h", |
| "pdf_ppapi.h", |
| ] |
| |
| sources = [ |
| "chunk_stream.h", |
| "document_loader.cc", |
| "document_loader.h", |
| "draw_utils.cc", |
| "draw_utils.h", |
| "out_of_process_instance.cc", |
| "out_of_process_instance.h", |
| "paint_aggregator.cc", |
| "paint_aggregator.h", |
| "paint_manager.cc", |
| "paint_manager.h", |
| "pdf.cc", |
| "pdf.h", |
| "pdf_engine.cc", |
| "pdf_engine.h", |
| "pdf_export.h", |
| "pdf_ppapi.cc", |
| "pdf_ppapi.h", |
| "preview_mode_client.cc", |
| "preview_mode_client.h", |
| "range_set.cc", |
| "range_set.h", |
| "timer.cc", |
| "timer.h", |
| "url_loader_wrapper.h", |
| "url_loader_wrapper_impl.cc", |
| "url_loader_wrapper_impl.h", |
| ] |
| |
| if (pdf_engine == 0) { |
| deps += [ |
| "//pdf/pdfium/fuzzers", |
| "//printing", |
| "//third_party/pdfium", |
| ] |
| |
| sources += [ |
| "pdfium/pdfium_api_string_buffer_adapter.cc", |
| "pdfium/pdfium_api_string_buffer_adapter.h", |
| "pdfium/pdfium_assert_matching_enums.cc", |
| "pdfium/pdfium_engine.cc", |
| "pdfium/pdfium_engine.h", |
| "pdfium/pdfium_mem_buffer_file_read.cc", |
| "pdfium/pdfium_mem_buffer_file_read.h", |
| "pdfium/pdfium_mem_buffer_file_write.cc", |
| "pdfium/pdfium_mem_buffer_file_write.h", |
| "pdfium/pdfium_page.cc", |
| "pdfium/pdfium_page.h", |
| "pdfium/pdfium_range.cc", |
| "pdfium/pdfium_range.h", |
| ] |
| } |
| |
| defines = [ |
| "PDF_IMPLEMENTATION", |
| "PDFIUM_PRINT_TEXT_WITH_GDI", |
| ] |
| if (pdf_enable_xfa) { |
| defines += [ "PDF_ENABLE_XFA" ] |
| } |
| } |
| |
| test("pdf_unittests") { |
| sources = [ |
| "chunk_stream_unittest.cc", |
| "document_loader_unittest.cc", |
| "range_set_unittest.cc", |
| "run_all_unittests.cc", |
| ] |
| |
| deps = [ |
| ":pdf", |
| "//base", |
| "//base/test:test_support", |
| "//ppapi/c", |
| "//ppapi/cpp", |
| "//testing/gmock", |
| "//testing/gtest", |
| "//ui/gfx/range", |
| ] |
| } |
| } else { |
| # Dummy group when PDF support is disabled so targets can unconditionally |
| # depend on it. |
| group("pdf") { |
| } |
| } |