summaryrefslogtreecommitdiff
path: root/build_gyp/gyp_pdfium
diff options
context:
space:
mode:
authordsinclair <dsinclair@chromium.org>2016-04-19 11:04:01 -0700
committerCommit bot <commit-bot@chromium.org>2016-04-19 11:04:02 -0700
commitc37b04e80aafc8437d458ced2366f825749ae2d7 (patch)
tree695828739b07bd9ede2dcfe5b84f6bfb148278de /build_gyp/gyp_pdfium
parenta28ae388f3859c52630deb6ef3d0ea468e5177e3 (diff)
downloadpdfium-c37b04e80aafc8437d458ced2366f825749ae2d7.tar.xz
Move build/ to build_gyp/.
This CL moves the build/ files to build_gyp/ in anticipation of pulling in Chromiums build/ directory. The gyp_pdfium files have been duplicated into both places. Once the bots are updated we'll remove the build/ versions. BUG=pdfium:106 Review URL: https://codereview.chromium.org/1900913003
Diffstat (limited to 'build_gyp/gyp_pdfium')
-rwxr-xr-xbuild_gyp/gyp_pdfium52
1 files changed, 52 insertions, 0 deletions
diff --git a/build_gyp/gyp_pdfium b/build_gyp/gyp_pdfium
new file mode 100755
index 0000000000..3dbbbeea75
--- /dev/null
+++ b/build_gyp/gyp_pdfium
@@ -0,0 +1,52 @@
+#!/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', '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(pdfium_root, 'build_gyp', 'all.gyp'))
+
+ args.append('-I')
+ args.append(os.path.join(pdfium_root, 'build_gyp', '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))
+
+ # GYP does not default to ninja, but PDFium should.
+ if not os.environ.get('GYP_GENERATORS', ''):
+ print 'GYP_GENERATORS is not set, defaulting to ninja'
+ os.environ['GYP_GENERATORS'] = 'ninja'
+
+ print 'Updating projects from gyp files...'
+ sys.stdout.flush()
+
+ run_gyp(args)
+
+
+if __name__ == '__main__':
+ sys.exit(main())