OLD | NEW |
---|---|
1 # Copyright (c) 2012 Google Inc. All rights reserved. | 1 # Copyright (c) 2012 Google Inc. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 from __future__ import with_statement | 5 from __future__ import with_statement |
6 | 6 |
7 import collections | 7 import collections |
8 import errno | 8 import errno |
9 import filecmp | 9 import filecmp |
10 import os.path | 10 import os.path |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
104 toolset = parsed_toolset | 104 toolset = parsed_toolset |
105 | 105 |
106 return [build_file, target, toolset] | 106 return [build_file, target, toolset] |
107 | 107 |
108 | 108 |
109 def BuildFile(fully_qualified_target): | 109 def BuildFile(fully_qualified_target): |
110 # Extracts the build file from the fully qualified target. | 110 # Extracts the build file from the fully qualified target. |
111 return ParseQualifiedTarget(fully_qualified_target)[0] | 111 return ParseQualifiedTarget(fully_qualified_target)[0] |
112 | 112 |
113 | 113 |
114 def OrderDeterministically(l, **kwargs): | |
Nico
2015/12/10 20:30:24
I'd just call sorted() directly everywhere. if som
Zachary Forman
2015/12/30 02:18:43
Yeah, seems reasonable. I've swapped it back to so
| |
115 """ Sorts l so that it is ordered deterministically. """ | |
116 return sorted(l, **kwargs) | |
117 | |
118 | |
114 def GetEnvironFallback(var_list, default): | 119 def GetEnvironFallback(var_list, default): |
115 """Look up a key in the environment, with fallback to secondary keys | 120 """Look up a key in the environment, with fallback to secondary keys |
116 and finally falling back to a default value.""" | 121 and finally falling back to a default value.""" |
117 for var in var_list: | 122 for var in var_list: |
118 if var in os.environ: | 123 if var in os.environ: |
119 return os.environ[var] | 124 return os.environ[var] |
120 return default | 125 return default |
121 | 126 |
122 | 127 |
123 def QualifiedTarget(build_file, target, toolset): | 128 def QualifiedTarget(build_file, target, toolset): |
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
599 def CrossCompileRequested(): | 604 def CrossCompileRequested(): |
600 # TODO: figure out how to not build extra host objects in the | 605 # TODO: figure out how to not build extra host objects in the |
601 # non-cross-compile case when this is enabled, and enable unconditionally. | 606 # non-cross-compile case when this is enabled, and enable unconditionally. |
602 return (os.environ.get('GYP_CROSSCOMPILE') or | 607 return (os.environ.get('GYP_CROSSCOMPILE') or |
603 os.environ.get('AR_host') or | 608 os.environ.get('AR_host') or |
604 os.environ.get('CC_host') or | 609 os.environ.get('CC_host') or |
605 os.environ.get('CXX_host') or | 610 os.environ.get('CXX_host') or |
606 os.environ.get('AR_target') or | 611 os.environ.get('AR_target') or |
607 os.environ.get('CC_target') or | 612 os.environ.get('CC_target') or |
608 os.environ.get('CXX_target')) | 613 os.environ.get('CXX_target')) |
OLD | NEW |