| Index: tools/gyp_flag_compare.py
|
| diff --git a/tools/gyp_flag_compare.py b/tools/gyp_flag_compare.py
|
| index 0c17b1a3356cc0298eb25353a76a3085c13875a0..b4432ba1254f3998319a23d35437b7508aec283d 100755
|
| --- a/tools/gyp_flag_compare.py
|
| +++ b/tools/gyp_flag_compare.py
|
| @@ -113,7 +113,7 @@ def CountsByDirname(dict_of_list):
|
| class Comparison(object):
|
| """A comparison of the currently-configured build for a target."""
|
|
|
| - def __init__(self, gyp_target, gn_target=None, gyp_dir=_DEFAULT_GYP_DIR,
|
| + def __init__(self, gyp_target=None, gn_target=None, gyp_dir=_DEFAULT_GYP_DIR,
|
| gn_dir=_DEFAULT_GN_DIR):
|
| """Creates a comparison of a GN and GYP target. If the target names differ
|
| between the two build systems, then two names may be passed.
|
| @@ -195,8 +195,13 @@ class Comparison(object):
|
| print >> sys.stderr, 'Building in %s...' % self._gyp_dir
|
| Run('ninja -C %s -d keeprsp %s' % (self._gyp_dir, self._gn_target))
|
|
|
| - gn = Run('ninja -C %s -t commands %s' % (self._gn_dir, self._gn_target))
|
| - gyp = Run('ninja -C %s -t commands %s' % (self._gyp_dir, self._gyp_target))
|
| + if self._gn_target is not None:
|
| + gn = Run('ninja -C %s -t commands %s' % (self._gn_dir, self._gn_target))
|
| + gyp = Run('ninja -C %s -t commands %s' % (self._gyp_dir,
|
| + self._gyp_target))
|
| + else:
|
| + gn = Run('ninja -C %s -t commands' % (self._gn_dir))
|
| + gyp = Run('ninja -C %s -t commands' % (self._gyp_dir))
|
|
|
| self._gn_flags = self._GetFlags(gn.splitlines(),
|
| os.path.join(os.getcwd(), self._gn_dir))
|
| @@ -389,7 +394,7 @@ def Run(command_line):
|
|
|
|
|
| def main():
|
| - if len(sys.argv) < 4:
|
| + if len(sys.argv) < 3:
|
| print 'usage: %s gyp_dir gn_dir target' % __file__
|
| print ' or: %s gyp_dir gn_dir gyp_target gn_target' % __file__
|
| return 1
|
| @@ -397,10 +402,13 @@ def main():
|
| gyp_dir = sys.argv[1]
|
| gn_dir = sys.argv[2]
|
|
|
| - gyp_target = sys.argv[3]
|
| + gyp_target = gn_target = None
|
| +
|
| if len(sys.argv) == 4:
|
| + gyp_target = sys.argv[3]
|
| gn_target = gyp_target
|
| - else:
|
| + elif len(sys.argv) == 5:
|
| + gyp_target = sys.argv[3]
|
| gn_target = sys.argv[4]
|
|
|
| print 'GYP output directory is %s' % gyp_dir
|
|
|