diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-10-09 12:45:15 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-10-09 12:45:15 -0700 |
commit | f1c713663192368d26031a4caed1f9705f4510af (patch) | |
tree | d7078da243fe29c2ac9160ab21725bee3a349a7b /samples/BUILD.gn | |
parent | c9952e66c588aad6a5996796fb0c96b202e6de0a (diff) | |
download | pdfium-f1c713663192368d26031a4caed1f9705f4510af.tar.xz |
Allow compiling PDFium without V8.
Original patch from issue 1391843004 at patchset 1
(http://crrev.com/1391843004#ps1)
Introduce a pdf_enable_v8 GYP variable, which controls a
corresponding PDF_ENABLE_V8 #define, and bring in the real
JS library when set. Otherwise, link against a stub JS
runtime.
BUG=pdfium:211
R=dml@google.com, jochen@chromium.org, thestig@chromium.org
Review URL: https://codereview.chromium.org/1395733006 .
Diffstat (limited to 'samples/BUILD.gn')
-rw-r--r-- | samples/BUILD.gn | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/samples/BUILD.gn b/samples/BUILD.gn index 6f4518c17e..5749de90f1 100644 --- a/samples/BUILD.gn +++ b/samples/BUILD.gn @@ -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("../pdfium.gni") + group("samples") { deps = [ ":pdfium_test", @@ -15,6 +17,11 @@ config("pdfium_samples_config") { "PNGPREFIX_H", "PNG_USE_READ_MACROS", ] + if (pdf_enable_v8) { + defines += [ + "PDF_ENABLE_V8", + ] + } } executable("pdfium_test") { @@ -28,13 +35,17 @@ executable("pdfium_test") { # always link this binary against the bundled one for consistency # of results across platforms. "//third_party/pdfium/third_party:fx_freetype", - "//v8:v8_libplatform", ":fx_lpng", ] - include_dirs = [ - "//v8", - "//v8/include", - ] + if (pdf_enable_v8) { + deps += [ + "//v8:v8_libplatform", + ] + include_dirs = [ + "//v8", + "//v8/include", + ] + } configs += [ ":pdfium_samples_config" ] } |