OLD | NEW |
1 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 1 # Copyright (c) 2012 The Native Client Authors. 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 """Harness for defining library dependencies for scons files.""" | 5 """Harness for defining library dependencies for scons files.""" |
6 | 6 |
7 | 7 |
8 # The following is a map from a library, to the corresponding | 8 # The following is a map from a library, to the corresponding |
9 # list of dependent libraries that must be included after that library, in | 9 # list of dependent libraries that must be included after that library, in |
10 # the list of libraries. | 10 # the list of libraries. |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 def VisitList(libraries): | 160 def VisitList(libraries): |
161 for library in reversed(libraries): | 161 for library in reversed(libraries): |
162 if library not in visited: | 162 if library not in visited: |
163 VisitLibrary(library) | 163 VisitLibrary(library) |
164 | 164 |
165 def GetLibraryDeps(library): | 165 def GetLibraryDeps(library): |
166 ret = (LIBRARY_DEPENDENCIES_DEFAULT.get(library, []) + | 166 ret = (LIBRARY_DEPENDENCIES_DEFAULT.get(library, []) + |
167 PLATFORM_LIBRARY_DEPENDENCIES.get(platform, {}).get(library, [])) | 167 PLATFORM_LIBRARY_DEPENDENCIES.get(platform, {}).get(library, [])) |
168 if env['NACL_BUILD_FAMILY'] != 'TRUSTED': | 168 if env['NACL_BUILD_FAMILY'] != 'TRUSTED': |
169 ret.extend(UNTRUSTED_LIBRARY_DEPENDENCIES.get(library, [])) | 169 ret.extend(UNTRUSTED_LIBRARY_DEPENDENCIES.get(library, [])) |
170 if library == 'validators' and env.Bit('target_x86'): | 170 if library == 'validators' and env.Bit('build_x86'): |
171 ret.append(env.NaClTargetArchSuffix('dfa_validate_caller')) | 171 ret.append(env.NaClTargetArchSuffix('dfa_validate_caller')) |
172 return ret | 172 return ret |
173 | 173 |
174 def VisitLibrary(library): | 174 def VisitLibrary(library): |
175 visited.add(library) | 175 visited.add(library) |
176 VisitList(GetLibraryDeps(library)) | 176 VisitList(GetLibraryDeps(library)) |
177 closure.append(library) | 177 closure.append(library) |
178 | 178 |
179 # Ideally we would just do "VisitList(libraries)" here, but some | 179 # Ideally we would just do "VisitList(libraries)" here, but some |
180 # PPAPI tests (specifically, tests/ppapi_gles_book) list "ppapi_cpp" | 180 # PPAPI tests (specifically, tests/ppapi_gles_book) list "ppapi_cpp" |
181 # twice in the link line, and we need to maintain these duplicates. | 181 # twice in the link line, and we need to maintain these duplicates. |
182 for library in reversed(libraries): | 182 for library in reversed(libraries): |
183 VisitLibrary(library) | 183 VisitLibrary(library) |
184 | 184 |
185 closure.reverse() | 185 closure.reverse() |
186 return closure | 186 return closure |
OLD | NEW |