From 70e2270a8ac049bbcef0f13ae0848e3a2d01966b Mon Sep 17 00:00:00 2001 From: John Abd-El-Malek Date: Thu, 22 May 2014 16:14:52 -0700 Subject: Create a standalone pdfium build. I moved pdfium_test from chromium's repo to pdfium's. It's now buildable as a sample following the instructions on the wiki. --- build/all.gyp | 15 +++ build/gyp_pdfium | 46 +++++++++ build/gyp_pdfium.py | 8 ++ build/standalone.gypi | 259 ++++++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 328 insertions(+) create mode 100644 build/all.gyp create mode 100644 build/gyp_pdfium create mode 100644 build/gyp_pdfium.py create mode 100644 build/standalone.gypi (limited to 'build') diff --git a/build/all.gyp b/build/all.gyp new file mode 100644 index 0000000000..e9229dd7c6 --- /dev/null +++ b/build/all.gyp @@ -0,0 +1,15 @@ +# Copyright 2014 PDFium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +{ + 'targets': [ + { + 'target_name': 'All', + 'type': 'none', + 'dependencies': [ + '../samples/samples.gyp:*', + ], + } + ] +} \ No newline at end of file diff --git a/build/gyp_pdfium b/build/gyp_pdfium new file mode 100644 index 0000000000..0458b96d13 --- /dev/null +++ b/build/gyp_pdfium @@ -0,0 +1,46 @@ +#!/usr/bin/env python +# +# Copyright 2014 PDFium 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 script is wrapper for PDFium that adds some support for how GYP +# is invoked by PDFium beyond what can be done in the gclient hooks. + +import os +import platform +import sys + +script_dir = os.path.dirname(os.path.realpath(__file__)) +pdfium_root = os.path.abspath(os.path.join(script_dir, os.pardir)) + +sys.path.insert(0, os.path.join(pdfium_root, 'build', 'gyp', 'pylib')) +import gyp + + +def run_gyp(args): + rc = gyp.main(args) + if rc != 0: + print 'Error running GYP' + sys.exit(rc) + + +def main(): + args = sys.argv[1:] + args.append(os.path.join(script_dir, 'all.gyp')) + + args.append('-I') + args.append(os.path.join(pdfium_root, 'build', 'standalone.gypi')) + + args.extend(['-D', 'gyp_output_dir=out']) + + # Set the GYP DEPTH variable to the root of the PDFium project. + args.append('--depth=' + os.path.relpath(pdfium_root)) + + print 'Updating projects from gyp files...' + sys.stdout.flush() + + run_gyp(args) + +if __name__ == '__main__': + sys.exit(main()) \ No newline at end of file diff --git a/build/gyp_pdfium.py b/build/gyp_pdfium.py new file mode 100644 index 0000000000..9776c302d4 --- /dev/null +++ b/build/gyp_pdfium.py @@ -0,0 +1,8 @@ +# Copyright 2014 PDFium 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 os + +path = os.path.abspath(os.path.split(__file__)[0]) +execfile(os.path.join(path, 'gyp_pdfium')) diff --git a/build/standalone.gypi b/build/standalone.gypi new file mode 100644 index 0000000000..970c0590c7 --- /dev/null +++ b/build/standalone.gypi @@ -0,0 +1,259 @@ +# Copyright 2014 PDFium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +# Definitions to be used when building stand-alone PDFium binaries. + +{ + 'variables': { + 'component%': 'static_library', + 'clang%': 0, + 'msvs_multi_core_compile%': '1', + 'variables': { + 'variables': { + 'variables': { + 'conditions': [ + ['OS=="linux" or OS=="mac"', { + # This handles the Unix platforms we generally deal with. + # Anything else gets passed through, which probably won't work + # very well; such hosts should pass an explicit target_arch + # to gyp. + 'host_arch%': + '