Index: build/gyp_pdfium |
diff --git a/build/gyp_pdfium b/build/gyp_pdfium |
new file mode 100644 |
index 0000000000000000000000000000000000000000..f29e178f2b9615abf66a24532bd3a0274d4d5299 |
--- /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) |
+ |
+ |
+if __name__ == '__main__': |
Nico
2014/05/23 21:14:33
(nit: since python only has two namespaces – globa
jam
2014/05/23 23:52:13
Done.
|
+ 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() |
+ |
+ # Generate for the architectures supported on the given platform. |
+ gyp_args = list(args) |
+ run_gyp(gyp_args) |
Nico
2014/05/23 21:14:33
nit: Just `run_gyp(args)` is probably enough. The
jam
2014/05/23 23:52:13
Done.
|
+ |
Nico
2014/05/23 21:14:33
nit: don't include an empty line at the end of the
jam
2014/05/23 23:52:13
Done.
|