Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Side by Side Diff: tools/gn/target.cc

Issue 1530183005: Special-case paths that appear in libs by not prefixing them with -l. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix typo in previous patch Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/gn/target.h ('k') | tools/gn/target_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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())
557 CheckSourceGenerated(all_libs_[i].source_file());
558 }
555 } 559 }
556 560
557 void Target::CheckSourceGenerated(const SourceFile& source) const { 561 void Target::CheckSourceGenerated(const SourceFile& source) const {
558 if (!IsStringInOutputDir(settings()->build_settings()->build_dir(), 562 if (!IsStringInOutputDir(settings()->build_settings()->build_dir(),
559 source.value())) 563 source.value()))
560 return; // Not in output dir, this is OK. 564 return; // Not in output dir, this is OK.
561 565
562 // Tell the scheduler about unknown files. This will be noted for later so 566 // 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) 567 // the list of files written by the GN build itself (often response files)
564 // can be filtered out of this list. 568 // can be filtered out of this list.
565 OutputFile out_file(settings()->build_settings(), source); 569 OutputFile out_file(settings()->build_settings(), source);
566 std::set<const Target*> seen_targets; 570 std::set<const Target*> seen_targets;
567 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, &seen_targets)) 571 if (!EnsureFileIsGeneratedByDependency(this, out_file, true, &seen_targets))
568 g_scheduler->AddUnknownGeneratedInput(this, source); 572 g_scheduler->AddUnknownGeneratedInput(this, source);
569 } 573 }
OLDNEW
« no previous file with comments | « tools/gn/target.h ('k') | tools/gn/target_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698