OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 | 2 |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium 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 Chromium that adds some support for how GYP | 7 # This script is wrapper for Chromium that adds some support for how GYP |
8 # is invoked by Chromium beyond what can be done in the gclient hooks. | 8 # is invoked by Chromium beyond what can be done in the gclient hooks. |
9 | 9 |
10 import glob | 10 import glob |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 specified_includes = set() | 171 specified_includes = set() |
172 for arg in args: | 172 for arg in args: |
173 if arg.startswith('-I') and len(arg) > 2: | 173 if arg.startswith('-I') and len(arg) > 2: |
174 specified_includes.add(os.path.realpath(arg[2:])) | 174 specified_includes.add(os.path.realpath(arg[2:])) |
175 | 175 |
176 result = [] | 176 result = [] |
177 def AddInclude(path): | 177 def AddInclude(path): |
178 if os.path.realpath(path) not in specified_includes: | 178 if os.path.realpath(path) not in specified_includes: |
179 result.append(path) | 179 result.append(path) |
180 | 180 |
| 181 if os.environ.get('GYP_INCLUDE_FIRST') != None: |
| 182 AddInclude(os.path.join(chrome_src, os.environ.get('GYP_INCLUDE_FIRST'))) |
| 183 |
181 # Always include common.gypi. | 184 # Always include common.gypi. |
182 AddInclude(os.path.join(script_dir, 'common.gypi')) | 185 AddInclude(os.path.join(script_dir, 'common.gypi')) |
183 | 186 |
184 # Optionally add supplemental .gypi files if present. | 187 # Optionally add supplemental .gypi files if present. |
185 for supplement in supplemental_files: | 188 for supplement in supplemental_files: |
186 AddInclude(supplement) | 189 AddInclude(supplement) |
187 | 190 |
| 191 if os.environ.get('GYP_INCLUDE_LAST') != None: |
| 192 AddInclude(os.path.join(chrome_src, os.environ.get('GYP_INCLUDE_LAST'))) |
| 193 |
188 return result | 194 return result |
189 | 195 |
190 | 196 |
191 if __name__ == '__main__': | 197 if __name__ == '__main__': |
192 # Disabling garbage collection saves about 1 second out of 16 on a Linux | 198 # Disabling garbage collection saves about 1 second out of 16 on a Linux |
193 # z620 workstation. Since this is a short-lived process it's not a problem to | 199 # z620 workstation. Since this is a short-lived process it's not a problem to |
194 # leak a few cyclyc references in order to spare the CPU cycles for | 200 # leak a few cyclyc references in order to spare the CPU cycles for |
195 # scanning the heap. | 201 # scanning the heap. |
196 import gc | 202 import gc |
197 gc.disable() | 203 gc.disable() |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
313 | 319 |
314 if not use_analyzer: | 320 if not use_analyzer: |
315 vs2013_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() | 321 vs2013_runtime_dll_dirs = vs_toolchain.SetEnvironmentAndGetRuntimeDllDirs() |
316 if vs2013_runtime_dll_dirs: | 322 if vs2013_runtime_dll_dirs: |
317 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs | 323 x64_runtime, x86_runtime = vs2013_runtime_dll_dirs |
318 vs_toolchain.CopyVsRuntimeDlls( | 324 vs_toolchain.CopyVsRuntimeDlls( |
319 os.path.join(chrome_src, GetOutputDirectory()), | 325 os.path.join(chrome_src, GetOutputDirectory()), |
320 (x86_runtime, x64_runtime)) | 326 (x86_runtime, x64_runtime)) |
321 | 327 |
322 sys.exit(gyp_rc) | 328 sys.exit(gyp_rc) |
OLD | NEW |