Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1427)

Unified Diff: pylib/gyp/input.py

Issue 7006031: Reapply r922 with the dependencies reversed. (Closed) Base URL: https://gyp.googlecode.com/svn/trunk
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pylib/gyp/input.py
diff --git a/pylib/gyp/input.py b/pylib/gyp/input.py
index 3fe7bc5fa8357cd874d4af8e7b100d437c8bc1a2..b0adabd7c4e09757edb61b245619c98ccfd33766 100644
--- a/pylib/gyp/input.py
+++ b/pylib/gyp/input.py
@@ -1545,6 +1545,20 @@ def AdjustStaticLibraryDependencies(flat_list, targets, dependency_nodes):
target_dict['dependencies'] = []
if not dependency in target_dict['dependencies']:
target_dict['dependencies'].append(dependency)
+ # Sort the dependencies list in the order from dependents to dependencies.
+ # e.g. If A and B depend on C and C depends on D, sort them in A, B, C, D.
+ # Note: flat_list is already sorted in the order from dependencies to
+ # dependents.
+ if 'dependencies' in target_dict:
+ target_dict['dependencies'] = [
+ dep for dep in flat_list if dep in target_dict['dependencies']]
+
+ # The final step to implement the above algorithm would be to reverse
+ # the dependencies:
+ # target_dict['dependencies'].reverse()
+ # as an experiment, leave this out so we can measure its impact on
+ # build performance.
+
# Initialize this here to speed up MakePathRelative.
exception_re = re.compile(r'''["']?[-/$<>]''')
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698