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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 cmdline_input_items += [sys.argv[i + 1]] | 122 cmdline_input_items += [sys.argv[i + 1]] |
123 cmdline_items = ProcessGypDefinesItems(cmdline_input_items) | 123 cmdline_items = ProcessGypDefinesItems(cmdline_input_items) |
124 | 124 |
125 return dict(supp_items + env_items + cmdline_items) | 125 return dict(supp_items + env_items + cmdline_items) |
126 | 126 |
127 | 127 |
128 def GetArgsStringForGN(supplemental_files): | 128 def GetArgsStringForGN(supplemental_files): |
129 """Returns the args to pass to GN. | 129 """Returns the args to pass to GN. |
130 Based on a subset of the GYP variables that have been rewritten a bit.""" | 130 Based on a subset of the GYP variables that have been rewritten a bit.""" |
131 | 131 |
132 # Find the .gyp directory in the user's home directory. | |
133 home_dot_gyp = os.environ.get('GYP_CONFIG_DIR', None) | |
brettw
2014/01/16 21:51:34
This block is just copied from GYP.
| |
134 if home_dot_gyp: | |
135 home_dot_gyp = os.path.expanduser(home_dot_gyp) | |
136 if not home_dot_gyp: | |
137 home_vars = ['HOME'] | |
138 if sys.platform in ('cygwin', 'win32'): | |
139 home_vars.append('USERPROFILE') | |
scottmg
2014/01/16 22:00:30
this seems a bit dumb, since this is the first thi
| |
140 for home_var in home_vars: | |
141 home = os.getenv(home_var) | |
142 if home != None: | |
143 home_dot_gyp = os.path.join(home, '.gyp') | |
144 if not os.path.exists(home_dot_gyp): | |
145 home_dot_gyp = None | |
146 else: | |
147 break | |
148 | |
149 include_gypi = os.path.join(home_dot_gyp, "include.gypi") | |
150 if os.path.exists(include_gypi): | |
151 supplemental_files += [include_gypi] | |
152 | |
132 vars_dict = GetGypVarsForGN(supplemental_files) | 153 vars_dict = GetGypVarsForGN(supplemental_files) |
133 gn_args = '' | 154 gn_args = '' |
134 | 155 |
135 # Note: These are the additional flags passed to various builds by builders | 156 # Note: These are the additional flags passed to various builds by builders |
136 # on the main waterfall. We'll probably need to add these at some point: | 157 # on the main waterfall. We'll probably need to add these at some point: |
137 # mac_strip_release=1 http://crbug.com/330301 | 158 # mac_strip_release=1 http://crbug.com/330301 |
138 # linux_dump_symbols=0 http://crbug.com/330300 | 159 # linux_dump_symbols=0 http://crbug.com/330300 |
139 # host_os=linux Probably can skip, GN knows the host OS. | 160 # host_os=linux Probably can skip, GN knows the host OS. |
140 # order_text_section=<path> http://crbug.com/330299 | 161 # order_text_section=<path> http://crbug.com/330299 |
141 # chromium_win_pch=0 http://crbug.com/297678 | 162 # chromium_win_pch=0 http://crbug.com/297678 |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
373 if not RunGN(supplemental_includes): | 394 if not RunGN(supplemental_includes): |
374 sys.exit(1) | 395 sys.exit(1) |
375 args.extend( | 396 args.extend( |
376 ['-I' + i for i in additional_include_files(supplemental_includes, args)]) | 397 ['-I' + i for i in additional_include_files(supplemental_includes, args)]) |
377 | 398 |
378 print 'Updating projects from gyp files...' | 399 print 'Updating projects from gyp files...' |
379 sys.stdout.flush() | 400 sys.stdout.flush() |
380 | 401 |
381 # Off we go... | 402 # Off we go... |
382 sys.exit(gyp.main(args)) | 403 sys.exit(gyp.main(args)) |
OLD | NEW |