| OLD | NEW | 
|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python | 
| 2 # | 2 # | 
| 3 # Copyright 2014 PDFium Authors. All rights reserved. | 3 # Copyright 2014 PDFium Authors. All rights reserved. | 
| 4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be | 
| 5 # found in the LICENSE file. | 5 # found in the LICENSE file. | 
| 6 | 6 | 
| 7 # This script is wrapper for PDFium that adds some support for how GYP | 7 # This script is wrapper for PDFium that adds some support for how GYP | 
| 8 # is invoked by PDFium beyond what can be done in the gclient hooks. | 8 # is invoked by PDFium beyond what can be done in the gclient hooks. | 
| 9 | 9 | 
| 10 import os | 10 import os | 
| (...skipping 10 matching lines...) Expand all  Loading... | 
| 21 def run_gyp(args): | 21 def run_gyp(args): | 
| 22   rc = gyp.main(args) | 22   rc = gyp.main(args) | 
| 23   if rc != 0: | 23   if rc != 0: | 
| 24     print 'Error running GYP' | 24     print 'Error running GYP' | 
| 25     sys.exit(rc) | 25     sys.exit(rc) | 
| 26 | 26 | 
| 27 | 27 | 
| 28 def main(): | 28 def main(): | 
| 29   args = sys.argv[1:] | 29   args = sys.argv[1:] | 
| 30   args.append(os.path.join(script_dir, 'all.gyp')) | 30   args.append(os.path.join(script_dir, 'all.gyp')) | 
| 31 | 31 | 
| 32   args.append('-I') | 32   args.append('-I') | 
| 33   args.append(os.path.join(pdfium_root, 'build', 'standalone.gypi')) | 33   args.append(os.path.join(pdfium_root, 'build', 'standalone.gypi')) | 
| 34 | 34 | 
| 35   args.extend(['-D', 'gyp_output_dir=out']) | 35   args.extend(['-D', 'gyp_output_dir=out']) | 
| 36 | 36 | 
| 37   # Set the GYP DEPTH variable to the root of the PDFium project. | 37   # Set the GYP DEPTH variable to the root of the PDFium project. | 
| 38   args.append('--depth=' + os.path.relpath(pdfium_root)) | 38   args.append('--depth=' + os.path.relpath(pdfium_root)) | 
| 39 | 39 | 
|  | 40   # GYP does not default to ninja, but PDFium should. | 
|  | 41   if not os.environ.get('GYP_GENERATORS', ''): | 
|  | 42     print 'GYP_GENERATORS is not set, defaulting to ninja' | 
|  | 43     os.environ['GYP_GENERATORS'] = 'ninja' | 
|  | 44 | 
| 40   print 'Updating projects from gyp files...' | 45   print 'Updating projects from gyp files...' | 
| 41   sys.stdout.flush() | 46   sys.stdout.flush() | 
| 42 | 47 | 
| 43   run_gyp(args) | 48   run_gyp(args) | 
| 44 | 49 | 
| 45 | 50 | 
| 46 if __name__ == '__main__': | 51 if __name__ == '__main__': | 
| 47   sys.exit(main()) | 52   sys.exit(main()) | 
| OLD | NEW | 
|---|