 Chromium Code Reviews
 Chromium Code Reviews Issue 10909158:
  Add support for building targets directly from gyp.  (Closed) 
  Base URL: http://gyp.googlecode.com/svn/trunk
    
  
    Issue 10909158:
  Add support for building targets directly from gyp.  (Closed) 
  Base URL: http://gyp.googlecode.com/svn/trunk| Index: pylib/gyp/generator/scons.py | 
| diff --git a/pylib/gyp/generator/scons.py b/pylib/gyp/generator/scons.py | 
| index 4d0feb0c9a4606a5da98b3739f7cf076a6c499f6..fe7cb581b3e1197b7bde7edc38729d81ad72db30 100644 | 
| --- a/pylib/gyp/generator/scons.py | 
| +++ b/pylib/gyp/generator/scons.py | 
| @@ -8,6 +8,7 @@ import gyp.SCons as SCons | 
| import os.path | 
| import pprint | 
| import re | 
| +import subprocess | 
| # TODO: remove when we delete the last WriteList() call in this module | 
| @@ -960,6 +961,30 @@ def TargetFilename(target, build_file=None, output_suffix=''): | 
| return output_file | 
| +def PerformBuild(data, configurations, params): | 
| + options = params['options'] | 
| + | 
| + # Due to the way we test gyp on the chromium typbots | 
| + # we need to look for 'scons.py' as well as the more common 'scons' | 
| + # TODO(sbc): update the trybots to have a more normal install | 
| + # of scons. | 
| + scons = 'scons' | 
| + paths = os.environ['PATH'].split(os.pathsep) | 
| + for scons_name in ['scons', 'scons.py']: | 
| + for path in paths: | 
| + test_scons = os.path.join(path, scons_name) | 
| + print 'looking for: %s' % test_scons | 
| + if os.path.exists(test_scons): | 
| + print "found scons: %s" % scons | 
| + scons = test_scons | 
| + break | 
| + | 
| + for config in configurations: | 
| + arguments = [scons, '-C', options.toplevel_dir, '--mode=%s' % config] | 
| + print "Building [%s]: %s" % (config, arguments) | 
| 
bradn
2012/09/18 00:22:39
single
 
Sam Clegg
2012/09/18 00:47:17
Done.
 | 
| + subprocess.check_call(arguments) | 
| + | 
| + | 
| def GenerateOutput(target_list, target_dicts, data, params): | 
| """ | 
| Generates all the output files for the specified targets. |