| 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 |
| (...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 output_type_ == SHARED_LIBRARY || | 411 output_type_ == SHARED_LIBRARY || |
| 412 output_type_ == LOADABLE_MODULE || | 412 output_type_ == LOADABLE_MODULE || |
| 413 output_type_ == ACTION || | 413 output_type_ == ACTION || |
| 414 output_type_ == ACTION_FOREACH || | 414 output_type_ == ACTION_FOREACH || |
| 415 output_type_ == COPY_FILES || | 415 output_type_ == COPY_FILES || |
| 416 output_type_ == CREATE_BUNDLE || | 416 output_type_ == CREATE_BUNDLE || |
| 417 (output_type_ == STATIC_LIBRARY && complete_static_lib_); | 417 (output_type_ == STATIC_LIBRARY && complete_static_lib_); |
| 418 } | 418 } |
| 419 | 419 |
| 420 DepsIteratorRange Target::GetDeps(DepsIterationType type) const { | 420 DepsIteratorRange Target::GetDeps(DepsIterationType type) const { |
| 421 if (type == DEPS_LINKED) { | 421 switch (type) { |
| 422 return DepsIteratorRange(DepsIterator( | 422 case DEPS_DATA: |
| 423 &public_deps_, &private_deps_, nullptr)); | 423 return DepsIteratorRange(DepsIterator(&data_deps_, nullptr, nullptr)); |
| 424 case DEPS_LINKED: |
| 425 return DepsIteratorRange( |
| 426 DepsIterator(&public_deps_, &private_deps_, nullptr)); |
| 427 case DEPS_PRIVATE: |
| 428 return DepsIteratorRange(DepsIterator(&private_deps_, nullptr, nullptr)); |
| 429 case DEPS_PUBLIC: |
| 430 return DepsIteratorRange(DepsIterator(&public_deps_, nullptr, nullptr)); |
| 431 default: |
| 432 // All deps. |
| 433 return DepsIteratorRange( |
| 434 DepsIterator(&public_deps_, &private_deps_, &data_deps_)); |
| 424 } | 435 } |
| 425 // All deps. | |
| 426 return DepsIteratorRange(DepsIterator( | |
| 427 &public_deps_, &private_deps_, &data_deps_)); | |
| 428 } | 436 } |
| 429 | 437 |
| 430 std::string Target::GetComputedOutputName() const { | 438 std::string Target::GetComputedOutputName() const { |
| 431 DCHECK(toolchain_) | 439 DCHECK(toolchain_) |
| 432 << "Toolchain must be specified before getting the computed output name."; | 440 << "Toolchain must be specified before getting the computed output name."; |
| 433 | 441 |
| 434 const std::string& name = output_name_.empty() ? label().name() | 442 const std::string& name = output_name_.empty() ? label().name() |
| 435 : output_name_; | 443 : output_name_; |
| 436 | 444 |
| 437 std::string result; | 445 std::string result; |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 check_data_deps = g_scheduler->IsFileGeneratedByWriteRuntimeDeps(out_file); | 863 check_data_deps = g_scheduler->IsFileGeneratedByWriteRuntimeDeps(out_file); |
| 856 // Check object files (much slower and very rare) only if the "normal" | 864 // Check object files (much slower and very rare) only if the "normal" |
| 857 // output check failed. | 865 // output check failed. |
| 858 consider_object_files = !check_data_deps; | 866 consider_object_files = !check_data_deps; |
| 859 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, | 867 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, |
| 860 consider_object_files, | 868 consider_object_files, |
| 861 check_data_deps, &seen_targets)) | 869 check_data_deps, &seen_targets)) |
| 862 g_scheduler->AddUnknownGeneratedInput(this, source); | 870 g_scheduler->AddUnknownGeneratedInput(this, source); |
| 863 } | 871 } |
| 864 } | 872 } |
| OLD | NEW |