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