Chromium Code Reviews| Index: pylib/gyp/generator/ninja.py |
| diff --git a/pylib/gyp/generator/ninja.py b/pylib/gyp/generator/ninja.py |
| index b13affe0a172392ae115201874d5f44223b38c38..549f06998cb55e0c57a2a1a60007b6b36b950bc5 100644 |
| --- a/pylib/gyp/generator/ninja.py |
| +++ b/pylib/gyp/generator/ninja.py |
| @@ -15,6 +15,7 @@ import sys |
| import gyp |
| import gyp.common |
| from gyp.common import OrderedSet |
| + |
|
Nico
2016/01/13 20:16:54
why this newline?
Zachary Forman
2016/01/18 20:44:36
Fixed
|
| import gyp.msvs_emulation |
| import gyp.MSVSUtil as MSVSUtil |
| import gyp.xcode_emulation |
| @@ -656,6 +657,7 @@ class NinjaWriter(object): |
| for var in special_locals: |
| if '${%s}' % var in argument: |
| needed_variables.add(var) |
| + needed_variables = sorted(needed_variables) |
| def cygwin_munge(path): |
| # pylint: disable=cell-var-from-loop |
| @@ -687,10 +689,8 @@ class NinjaWriter(object): |
| outputs = [self.ExpandRuleVariables(o, root, dirname, |
| source, ext, basename) |
| for o in rule['outputs']] |
| - |
|
Nico
2016/01/13 20:16:54
what was wrong with the 3 newlines here?
Zachary Forman
2016/01/18 20:44:36
Reverted
|
| if int(rule.get('process_outputs_as_sources', False)): |
| extra_sources += outputs |
| - |
| was_mac_bundle_resource = source in mac_bundle_resources |
| if was_mac_bundle_resource or \ |
| int(rule.get('process_outputs_as_mac_bundle_resources', False)): |
| @@ -700,7 +700,6 @@ class NinjaWriter(object): |
| # a performance issue. |
| if was_mac_bundle_resource: |
| mac_bundle_resources.remove(source) |
| - |
| extra_bindings = [] |
| for var in needed_variables: |
| if var == 'root': |
| @@ -729,6 +728,7 @@ class NinjaWriter(object): |
| # WriteNewNinjaRule uses unique_name for creating an rsp file on win. |
| extra_bindings.append(('unique_name', |
| hashlib.md5(outputs[0]).hexdigest())) |
| + |
| self.ninja.build(outputs, rule_name, self.GypPathToNinja(source), |
| implicit=inputs, |
| order_only=prebuild, |
| @@ -1252,10 +1252,11 @@ class NinjaWriter(object): |
| if len(solibs): |
| - extra_bindings.append(('solibs', gyp.common.EncodePOSIXShellList(solibs))) |
| + extra_bindings.append(('solibs', |
| + gyp.common.EncodePOSIXShellList(sorted(solibs)))) |
| ninja_file.build(output, command + command_suffix, link_deps, |
| - implicit=list(implicit_deps), |
| + implicit=sorted(implicit_deps), |
| order_only=list(order_deps), |
| variables=extra_bindings) |
| return linked_binary |
| @@ -1901,7 +1902,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, |
| configs, generator_flags) |
| cl_paths = gyp.msvs_emulation.GenerateEnvironmentFiles( |
| toplevel_build, generator_flags, shared_system_includes, OpenOutput) |
| - for arch, path in cl_paths.iteritems(): |
| + for arch, path in sorted(cl_paths.iteritems()): |
| if clang_cl: |
| # If we have selected clang-cl, use that instead. |
| path = clang_cl |
| @@ -2337,9 +2338,9 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, |
| # able to run actions and build libraries by their short name. |
| master_ninja.newline() |
| master_ninja.comment('Short names for targets.') |
| - for short_name in target_short_names: |
| - master_ninja.build(short_name, 'phony', [x.FinalOutput() for x in |
| - target_short_names[short_name]]) |
| + for short_name in sorted(target_short_names): |
| + master_ninja.build(short_name, 'phony', ([x.FinalOutput() for x in |
|
Nico
2016/01/13 20:16:54
why the additional parens?
Zachary Forman
2016/01/18 20:44:36
Corrected.
|
| + target_short_names[short_name]])) |
| # Write phony targets for any empty targets that weren't written yet. As |
| # short names are not necessarily unique only do this for short names that |
| @@ -2353,7 +2354,7 @@ def GenerateOutputForConfig(target_list, target_dicts, data, params, |
| if all_outputs: |
| master_ninja.newline() |
| - master_ninja.build('all', 'phony', list(all_outputs)) |
| + master_ninja.build('all', 'phony', sorted(all_outputs)) |
| master_ninja.default(generator_flags.get('default_target', 'all')) |
| master_ninja_file.close() |