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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/stringprintf.h" | 9 #include "base/strings/stringprintf.h" |
10 #include "tools/gn/config_values_extractors.h" | 10 #include "tools/gn/config_values_extractors.h" |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
545 // Checks that any inputs or sources to this target that are in the build | 545 // Checks that any inputs or sources to this target that are in the build |
546 // directory are generated by a target that this one transitively depends on | 546 // directory are generated by a target that this one transitively depends on |
547 // in some way. We already guarantee that all generated files are written | 547 // in some way. We already guarantee that all generated files are written |
548 // to the build dir. | 548 // to the build dir. |
549 // | 549 // |
550 // See Scheduler::AddUnknownGeneratedInput's declaration for more. | 550 // See Scheduler::AddUnknownGeneratedInput's declaration for more. |
551 for (const SourceFile& file : sources_) | 551 for (const SourceFile& file : sources_) |
552 CheckSourceGenerated(file); | 552 CheckSourceGenerated(file); |
553 for (const SourceFile& file : inputs_) | 553 for (const SourceFile& file : inputs_) |
554 CheckSourceGenerated(file); | 554 CheckSourceGenerated(file); |
555 for (size_t i = 0; i < all_libs_.size(); i++) { | |
556 if (all_libs_[i].is_source_file()) { | |
brettw
2015/12/18 00:04:55
No {}
agrieve
2015/12/18 15:39:08
Done.
| |
557 CheckSourceGenerated(all_libs_[i].source_file()); | |
558 } | |
559 } | |
555 } | 560 } |
556 | 561 |
557 void Target::CheckSourceGenerated(const SourceFile& source) const { | 562 void Target::CheckSourceGenerated(const SourceFile& source) const { |
558 if (!IsStringInOutputDir(settings()->build_settings()->build_dir(), | 563 if (!IsStringInOutputDir(settings()->build_settings()->build_dir(), |
559 source.value())) | 564 source.value())) |
560 return; // Not in output dir, this is OK. | 565 return; // Not in output dir, this is OK. |
561 | 566 |
562 // Tell the scheduler about unknown files. This will be noted for later so | 567 // Tell the scheduler about unknown files. This will be noted for later so |
563 // the list of files written by the GN build itself (often response files) | 568 // the list of files written by the GN build itself (often response files) |
564 // can be filtered out of this list. | 569 // can be filtered out of this list. |
565 OutputFile out_file(settings()->build_settings(), source); | 570 OutputFile out_file(settings()->build_settings(), source); |
566 std::set<const Target*> seen_targets; | 571 std::set<const Target*> seen_targets; |
567 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, &seen_targets)) | 572 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, &seen_targets)) |
568 g_scheduler->AddUnknownGeneratedInput(this, source); | 573 g_scheduler->AddUnknownGeneratedInput(this, source); |
569 } | 574 } |
OLD | NEW |