diff options
author | John Abd-El-Malek <jam@chromium.org> | 2014-05-22 16:14:52 -0700 |
---|---|---|
committer | John Abd-El-Malek <jam@chromium.org> | 2014-05-23 16:55:40 -0700 |
commit | 70e2270a8ac049bbcef0f13ae0848e3a2d01966b (patch) | |
tree | 5926bf475df15d3607033eb8f9416d5ae56c3c83 /build/gyp_pdfium | |
parent | 3ce25e68aa8f6d4b880ce4e0e9f123d117fcbd0c (diff) | |
download | pdfium-70e2270a8ac049bbcef0f13ae0848e3a2d01966b.tar.xz |
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.
Diffstat (limited to 'build/gyp_pdfium')
-rw-r--r-- | build/gyp_pdfium | 46 |
1 files changed, 46 insertions, 0 deletions
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 |