OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 | 2 |
3 # Copyright 2011 The Android Open Source Project | 3 # Copyright 2011 The Android Open Source Project |
4 # | 4 # |
5 # Use of this source code is governed by a BSD-style license that can be | 5 # Use of this source code is governed by a BSD-style license that can be |
6 # found in the LICENSE file. | 6 # found in the LICENSE file. |
7 | 7 |
8 # This script is a wrapper which invokes gyp with the correct --depth argument, | 8 # This script is a wrapper which invokes gyp with the correct --depth argument, |
9 # and supports the automatic regeneration of build files if all.gyp is | 9 # and supports the automatic regeneration of build files if all.gyp is |
10 # changed (Linux-only). | 10 # changed (Linux-only). |
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 default_gyp_generators = 'ninja,xcode' | 86 default_gyp_generators = 'ninja,xcode' |
87 elif sys.platform.startswith('win'): | 87 elif sys.platform.startswith('win'): |
88 default_gyp_generators = 'ninja,msvs-ninja' | 88 default_gyp_generators = 'ninja,msvs-ninja' |
89 elif sys.platform.startswith('cygwin'): | 89 elif sys.platform.startswith('cygwin'): |
90 default_gyp_generators = 'ninja,msvs-ninja' | 90 default_gyp_generators = 'ninja,msvs-ninja' |
91 else: | 91 else: |
92 default_gyp_generators = 'ninja' | 92 default_gyp_generators = 'ninja' |
93 os.environ[ENVVAR_GYP_GENERATORS] = default_gyp_generators | 93 os.environ[ENVVAR_GYP_GENERATORS] = default_gyp_generators |
94 print '%s is "%s"' % (ENVVAR_GYP_GENERATORS, os.getenv(ENVVAR_GYP_GENERATORS)) | 94 print '%s is "%s"' % (ENVVAR_GYP_GENERATORS, os.getenv(ENVVAR_GYP_GENERATORS)) |
95 | 95 |
| 96 vs2013_runtime_dll_dirs = None |
96 if os.getenv('CHROME_HEADLESS', '0') == '1': | 97 if os.getenv('CHROME_HEADLESS', '0') == '1': |
97 if sys.platform.startswith('win') or sys.platform.startswith('cygwin'): | 98 if sys.platform.startswith('win') or sys.platform.startswith('cygwin'): |
98 chrome_path = os.getenv('CHROME_PATH') | 99 chrome_path = os.getenv('CHROME_PATH') |
99 os.chdir(chrome_path) | 100 os.chdir(chrome_path) |
100 sys.path.append(os.path.join(chrome_path, 'build')) | 101 sys.path.append(os.path.join(chrome_path, 'build')) |
101 sys.path.append(os.path.join(chrome_path, 'tools')) | 102 sys.path.append(os.path.join(chrome_path, 'tools')) |
102 import vs_toolchain | 103 import vs_toolchain |
103 vs_toolchain.Update() | 104 vs2013_runtime_dll_dirs = \ |
104 vs_toolchain.GetToolchainDir() | 105 vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() |
105 | 106 |
106 # Set CWD to the directory containing this script. | 107 # Set CWD to the directory containing this script. |
107 # This allows us to launch it from other directories, in spite of gyp's | 108 # This allows us to launch it from other directories, in spite of gyp's |
108 # finickyness about the current working directory. | 109 # finickyness about the current working directory. |
109 # See http://b.corp.google.com/issue?id=5019517 ('Linux make build | 110 # See http://b.corp.google.com/issue?id=5019517 ('Linux make build |
110 # (from out dir) no longer runs skia_gyp correctly') | 111 # (from out dir) no longer runs skia_gyp correctly') |
111 os.chdir(os.path.abspath(script_dir)) | 112 os.chdir(os.path.abspath(script_dir)) |
112 | 113 |
113 # This could give false positives since it doesn't actually do real option | 114 # This could give false positives since it doesn't actually do real option |
114 # parsing. Oh well. | 115 # parsing. Oh well. |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 os.environ['GYP_LINK_CONCURRENCY'] = '9001' | 151 os.environ['GYP_LINK_CONCURRENCY'] = '9001' |
151 | 152 |
152 print 'Updating projects from gyp files...' | 153 print 'Updating projects from gyp files...' |
153 sys.stdout.flush() | 154 sys.stdout.flush() |
154 | 155 |
155 if '--dry-run' in args: | 156 if '--dry-run' in args: |
156 args.remove('--dry-run') | 157 args.remove('--dry-run') |
157 print gyp_source_dir, ' '.join(args) | 158 print gyp_source_dir, ' '.join(args) |
158 else: | 159 else: |
159 # Off we go... | 160 # Off we go... |
160 sys.exit(gyp.main(args)) | 161 res = gyp.main(args) |
| 162 if res: |
| 163 sys.exit(res) |
| 164 |
| 165 # This code is copied from Chrome's build/gyp_chromium. It's not clear why |
| 166 # the *_runtime variables are reversed. |
| 167 if vs2013_runtime_dll_dirs: |
| 168 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs |
| 169 vs_toolchain.CopyVsRuntimeDlls( |
| 170 os.path.join(os.getenv('CHROME_PATH'), get_output_dir()), |
| 171 (x86_runtime, x64_runtime)) |
OLD | NEW |