OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium 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 #include "tools/gn/target.h" | 5 #include "tools/gn/target.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
11 #include "base/bind.h" | 11 #include "base/bind.h" |
12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
14 #include "tools/gn/config_values_extractors.h" | 14 #include "tools/gn/config_values_extractors.h" |
15 #include "tools/gn/deps_iterator.h" | 15 #include "tools/gn/deps_iterator.h" |
16 #include "tools/gn/filesystem_utils.h" | 16 #include "tools/gn/filesystem_utils.h" |
| 17 #include "tools/gn/functions.h" |
17 #include "tools/gn/scheduler.h" | 18 #include "tools/gn/scheduler.h" |
18 #include "tools/gn/source_file_type.h" | 19 #include "tools/gn/source_file_type.h" |
19 #include "tools/gn/substitution_writer.h" | 20 #include "tools/gn/substitution_writer.h" |
20 #include "tools/gn/tool.h" | 21 #include "tools/gn/tool.h" |
21 #include "tools/gn/toolchain.h" | 22 #include "tools/gn/toolchain.h" |
22 #include "tools/gn/trace.h" | 23 #include "tools/gn/trace.h" |
23 | 24 |
24 namespace { | 25 namespace { |
25 | 26 |
26 typedef std::set<const Config*> ConfigSet; | 27 typedef std::set<const Config*> ConfigSet; |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
208 toolchain_(nullptr) { | 209 toolchain_(nullptr) { |
209 } | 210 } |
210 | 211 |
211 Target::~Target() { | 212 Target::~Target() { |
212 } | 213 } |
213 | 214 |
214 // static | 215 // static |
215 const char* Target::GetStringForOutputType(OutputType type) { | 216 const char* Target::GetStringForOutputType(OutputType type) { |
216 switch (type) { | 217 switch (type) { |
217 case UNKNOWN: | 218 case UNKNOWN: |
218 return "Unknown"; | 219 return "unknown"; |
219 case GROUP: | 220 case GROUP: |
220 return "Group"; | 221 return functions::kGroup; |
221 case EXECUTABLE: | 222 case EXECUTABLE: |
222 return "Executable"; | 223 return functions::kExecutable; |
223 case LOADABLE_MODULE: | 224 case LOADABLE_MODULE: |
224 return "Loadable module"; | 225 return functions::kLoadableModule; |
225 case SHARED_LIBRARY: | 226 case SHARED_LIBRARY: |
226 return "Shared library"; | 227 return functions::kSharedLibrary; |
227 case STATIC_LIBRARY: | 228 case STATIC_LIBRARY: |
228 return "Static library"; | 229 return functions::kStaticLibrary; |
229 case SOURCE_SET: | 230 case SOURCE_SET: |
230 return "Source set"; | 231 return functions::kSourceSet; |
231 case COPY_FILES: | 232 case COPY_FILES: |
232 return "Copy"; | 233 return functions::kCopy; |
233 case ACTION: | 234 case ACTION: |
234 return "Action"; | 235 return functions::kAction; |
235 case ACTION_FOREACH: | 236 case ACTION_FOREACH: |
236 return "ActionForEach"; | 237 return functions::kActionForEach; |
237 case BUNDLE_DATA: | 238 case BUNDLE_DATA: |
238 return "Bundle data"; | 239 return functions::kBundleData; |
239 case CREATE_BUNDLE: | 240 case CREATE_BUNDLE: |
240 return "Create bundle"; | 241 return functions::kCreateBundle; |
241 default: | 242 default: |
242 return ""; | 243 return ""; |
243 } | 244 } |
244 } | 245 } |
245 | 246 |
246 Target* Target::AsTarget() { | 247 Target* Target::AsTarget() { |
247 return this; | 248 return this; |
248 } | 249 } |
249 | 250 |
250 const Target* Target::AsTarget() const { | 251 const Target* Target::AsTarget() const { |
(...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
760 check_data_deps = g_scheduler->IsFileGeneratedByWriteRuntimeDeps(out_file); | 761 check_data_deps = g_scheduler->IsFileGeneratedByWriteRuntimeDeps(out_file); |
761 // Check object files (much slower and very rare) only if the "normal" | 762 // Check object files (much slower and very rare) only if the "normal" |
762 // output check failed. | 763 // output check failed. |
763 consider_object_files = !check_data_deps; | 764 consider_object_files = !check_data_deps; |
764 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, | 765 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, |
765 consider_object_files, | 766 consider_object_files, |
766 check_data_deps, &seen_targets)) | 767 check_data_deps, &seen_targets)) |
767 g_scheduler->AddUnknownGeneratedInput(this, source); | 768 g_scheduler->AddUnknownGeneratedInput(this, source); |
768 } | 769 } |
769 } | 770 } |
OLD | NEW |