summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore4
-rw-r--r--DEPS4
-rw-r--r--README.md12
-rwxr-xr-xbuild/gyp_pdfium6
-rw-r--r--build_gyp/all.gyp (renamed from build/all.gyp)0
-rwxr-xr-xbuild_gyp/gyp_pdfium52
-rw-r--r--build_gyp/gyp_pdfium.py8
-rw-r--r--build_gyp/mac_find_sdk.py (renamed from build/mac_find_sdk.py)0
-rw-r--r--build_gyp/set_clang_warning_flags.gypi (renamed from build/set_clang_warning_flags.gypi)0
-rw-r--r--build_gyp/standalone.gypi (renamed from build/standalone.gypi)2
10 files changed, 73 insertions, 15 deletions
diff --git a/.gitignore b/.gitignore
index 45bcec530e..ae54040af9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,4 @@
-/build/Debug
-/build/Release
-/build/gyp
+/build_gyp/gyp
/buildtools
/out
/testing/corpus
diff --git a/DEPS b/DEPS
index 265f452089..d846d20906 100644
--- a/DEPS
+++ b/DEPS
@@ -18,7 +18,7 @@ vars = {
}
deps = {
- "build/gyp":
+ "build_gyp/gyp":
Var('chromium_git') + "/external/gyp",
"buildtools":
@@ -68,7 +68,7 @@ hooks = [
# A change to a .gyp, .gypi, or to GYP itself should run the generator.
'name': 'gyp',
'pattern': '.',
- 'action': ['python', 'pdfium/build/gyp_pdfium'],
+ 'action': ['python', 'pdfium/build_gyp/gyp_pdfium'],
},
# Pull GN binaries. This needs to be before running GYP below.
{
diff --git a/README.md b/README.md
index 24fc1f3d7b..53e1b4b8f5 100644
--- a/README.md
+++ b/README.md
@@ -38,8 +38,8 @@ Previously, the second option (platform-specific build files) was the default.
Most PDFium developers use Ninja, as does our [continuous build system]
(http://build.chromium.org/p/client.pdfium/).
- * On Windows: `build\gyp_pdfium`
- * For all other platforms: `build/gyp_pdfium`
+ * On Windows: `build_gyp\gyp_pdfium`
+ * For all other platforms: `build_gyp/gyp_pdfium`
The second option is to generate platform-specific build files, i.e. Makefiles
on Linux, sln files on Windows, and xcodeproj files on Mac. To do so, set the
@@ -56,7 +56,7 @@ To build without XFA, set `pdf_enable_xfa=0` before running `gyp_pdfium`.
To build without JavaScript, set `pdf_enable_v8=0 pdf_enable_xfa=0` before
running `gyp_pdfium`. For example
```
-GYP_DEFINES='pdf_enable_v8=0 pdf_enable_xfa=0' build/gyp_pdfium
+GYP_DEFINES='pdf_enable_v8=0 pdf_enable_xfa=0' build_gyp/gyp_pdfium
```
gives the smallest possible build configuration.
@@ -67,7 +67,7 @@ you installed goma in a non-standard location, you will also need to set
`gomadir`. e.g.
```
-build/gyp_pdfium -D use_goma=1 -D gomadir=path/to/goma
+build_gyp/gyp_pdfium -D use_goma=1 -D gomadir=path/to/goma
```
## Building the code
@@ -79,8 +79,8 @@ tests) by: `ninja -C out/Debug`.
If you're not using Ninja, then building is platform-specific.
* On Linux: `make pdfium_test`
- * On Mac: `open build/all.xcodeproj`
- * On Windows: open build\all.sln
+ * On Mac: `open build_gyp/all.xcodeproj`
+ * On Windows: open build_gyp\all.sln
## Running the sample program
diff --git a/build/gyp_pdfium b/build/gyp_pdfium
index fca2ca39b6..3dbbbeea75 100755
--- a/build/gyp_pdfium
+++ b/build/gyp_pdfium
@@ -14,7 +14,7 @@ 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'))
+sys.path.insert(0, os.path.join(pdfium_root, 'build_gyp', 'gyp', 'pylib'))
import gyp
@@ -27,10 +27,10 @@ def run_gyp(args):
def main():
args = sys.argv[1:]
- args.append(os.path.join(script_dir, 'all.gyp'))
+ args.append(os.path.join(pdfium_root, 'build_gyp', 'all.gyp'))
args.append('-I')
- args.append(os.path.join(pdfium_root, 'build', 'standalone.gypi'))
+ args.append(os.path.join(pdfium_root, 'build_gyp', 'standalone.gypi'))
args.extend(['-D', 'gyp_output_dir=out'])
diff --git a/build/all.gyp b/build_gyp/all.gyp
index 47097e39b4..47097e39b4 100644
--- a/build/all.gyp
+++ b/build_gyp/all.gyp
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())
diff --git a/build_gyp/gyp_pdfium.py b/build_gyp/gyp_pdfium.py
new file mode 100644
index 0000000000..6831702b54
--- /dev/null
+++ b/build_gyp/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/mac_find_sdk.py b/build_gyp/mac_find_sdk.py
index 230c2fd52e..230c2fd52e 100644
--- a/build/mac_find_sdk.py
+++ b/build_gyp/mac_find_sdk.py
diff --git a/build/set_clang_warning_flags.gypi b/build_gyp/set_clang_warning_flags.gypi
index f6d7aea700..f6d7aea700 100644
--- a/build/set_clang_warning_flags.gypi
+++ b/build_gyp/set_clang_warning_flags.gypi
diff --git a/build/standalone.gypi b/build_gyp/standalone.gypi
index 925326b794..7292947226 100644
--- a/build/standalone.gypi
+++ b/build_gyp/standalone.gypi
@@ -454,7 +454,7 @@
], # target_conditions
'variables': {
'mac_sdk_min': '10.10',
- 'mac_sdk%': '<!(python <(DEPTH)/build/mac_find_sdk.py <(mac_sdk_min))',
+ 'mac_sdk%': '<!(python <(DEPTH)/build_gyp/mac_find_sdk.py <(mac_sdk_min))',
},
'xcode_settings': {
'SDKROOT': 'macosx<(mac_sdk)', # -isysroot