Reland of Allow overriding GN build flags
This reverts commit 038bf0b129e56212a6de0989dca1ae023bb17c5d.
In order to enable XFA from GN builds we need to be able to override
pdf_enable_xfa. To do this a build_overrides/pdfium.gni file needs to be created
in Chrome. To use that, //pdfium.gni reads the override values and sets them
into the defined arguments. We have to create a build_overrides/pdfium.gni file
in PDFium that sets the default overrides for PDFium builds.
BUG=chromium:62400
Review-Url: https://codereview.chromium.org/1936313002
diff --git a/build_overrides/pdfium.gni b/build_overrides/pdfium.gni
new file mode 100644
index 0000000..246671b
--- /dev/null
+++ b/build_overrides/pdfium.gni
@@ -0,0 +1,14 @@
+# Copyright 2016 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.
+
+# This file contains PDFium-related build overrides.
+
+# Build PDFium either with or without v8 support.
+pdf_enable_v8_override = true
+
+# Build PDFium either with or without XFA Forms support.
+pdf_enable_xfa_override = false
+
+# Build PDFium against skia (experimental) rather than agg.
+pdf_use_skia_override = false
diff --git a/pdfium.gni b/pdfium.gni
index b85ac74..9e20f96 100644
--- a/pdfium.gni
+++ b/pdfium.gni
@@ -2,6 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
+import("//build_overrides/pdfium.gni")
+
# This file contains PDFium-related build flags.
declare_args() {
@@ -10,13 +12,13 @@
pdfium_bundle_freetype = !is_linux
# Build PDFium either with or without v8 support.
- pdf_enable_v8 = true
+ pdf_enable_v8 = pdf_enable_v8_override
# Build PDFium either with or without XFA Forms support.
- pdf_enable_xfa = false
+ pdf_enable_xfa = pdf_enable_xfa_override
# Build PDFium against skia (experimental) rather than agg.
- pdf_use_skia = false
+ pdf_use_skia = pdf_use_skia_override
# Build PDFium standalone
pdf_is_standalone = false