| 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 |
| 11 import platform | 11 import platform |
| 12 import sys | 12 import sys |
| 13 | 13 |
| 14 script_dir = os.path.dirname(os.path.realpath(__file__)) | 14 script_dir = os.path.dirname(os.path.realpath(__file__)) |
| 15 pdfium_root = os.path.abspath(os.path.join(script_dir, os.pardir)) | 15 pdfium_root = os.path.abspath(os.path.join(script_dir, os.pardir)) |
| 16 output_rel_dir = 'out' | 16 output_rel_dir = 'out' |
| 17 | 17 |
| 18 sys.path.insert(0, os.path.join(pdfium_root, 'tools', 'gyp', 'pylib')) | 18 sys.path.insert(0, os.path.join(pdfium_root, 'tools', 'gyp', 'pylib')) |
| 19 import gyp | 19 import gyp |
| 20 |
| 20 # vs_toolchain needs to be after gyp path setting since it also uses gyp. | 21 # vs_toolchain needs to be after gyp path setting since it also uses gyp. |
| 22 sys.path.insert(0, os.path.join(pdfium_root, 'build')) |
| 21 import vs_toolchain | 23 import vs_toolchain |
| 22 | 24 |
| 23 def run_gyp(args): | 25 def run_gyp(args): |
| 24 rc = gyp.main(args) | 26 rc = gyp.main(args) |
| 25 | 27 |
| 26 # Copy Windows toolchain DLLs. | 28 # Copy Windows toolchain DLLs. |
| 27 vs_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() | 29 vs_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() |
| 28 if vs_runtime_dll_dirs: | 30 if vs_runtime_dll_dirs: |
| 29 x64_runtime, x86_runtime = vs_runtime_dll_dirs | 31 x64_runtime, x86_runtime = vs_runtime_dll_dirs |
| 30 vs_toolchain.CopyVsRuntimeDlls( | 32 vs_toolchain.CopyVsRuntimeDlls( |
| (...skipping 29 matching lines...) Expand all Loading... |
| 60 vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() | 62 vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() |
| 61 | 63 |
| 62 print 'Updating projects from gyp files...' | 64 print 'Updating projects from gyp files...' |
| 63 sys.stdout.flush() | 65 sys.stdout.flush() |
| 64 | 66 |
| 65 run_gyp(args) | 67 run_gyp(args) |
| 66 | 68 |
| 67 | 69 |
| 68 if __name__ == '__main__': | 70 if __name__ == '__main__': |
| 69 sys.exit(main()) | 71 sys.exit(main()) |
| OLD | NEW |