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

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

Issue 2387763002: Support for source_target_relative expansion in GN (Closed)
Patch Set: Rebased Created 4 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/ninja_action_target_writer.cc ('k') | tools/gn/substitution_type.h » ('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/ninja_copy_target_writer.h" 5 #include "tools/gn/ninja_copy_target_writer.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "tools/gn/ninja_utils.h" 8 #include "tools/gn/ninja_utils.h"
9 #include "tools/gn/output_file.h" 9 #include "tools/gn/output_file.h"
10 #include "tools/gn/scheduler.h" 10 #include "tools/gn/scheduler.h"
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 // Moreover, doing this assumes that the copy step is always a simple 96 // Moreover, doing this assumes that the copy step is always a simple
97 // locally run command, so there is no need for a toolchain dependency. 97 // locally run command, so there is no need for a toolchain dependency.
98 // 98 //
99 // Note that there is the need in some cases for order-only dependencies 99 // Note that there is the need in some cases for order-only dependencies
100 // where a command might need to make sure something else runs before it runs 100 // where a command might need to make sure something else runs before it runs
101 // to avoid conflicts. Such cases should be avoided where possible, but 101 // to avoid conflicts. Such cases should be avoided where possible, but
102 // sometimes that's not possible. 102 // sometimes that's not possible.
103 for (const auto& input_file : target_->sources()) { 103 for (const auto& input_file : target_->sources()) {
104 OutputFile output_file = 104 OutputFile output_file =
105 SubstitutionWriter::ApplyPatternToSourceAsOutputFile( 105 SubstitutionWriter::ApplyPatternToSourceAsOutputFile(
106 target_->settings(), output_subst, input_file); 106 target_, target_->settings(), output_subst, input_file);
107 output_files->push_back(output_file); 107 output_files->push_back(output_file);
108 108
109 out_ << "build "; 109 out_ << "build ";
110 path_output_.WriteFile(out_, output_file); 110 path_output_.WriteFile(out_, output_file);
111 out_ << ": " << tool_name << " "; 111 out_ << ": " << tool_name << " ";
112 path_output_.WriteFile(out_, input_file); 112 path_output_.WriteFile(out_, input_file);
113 if (!input_dep.value().empty()) { 113 if (!input_dep.value().empty()) {
114 out_ << " || "; 114 out_ << " || ";
115 path_output_.WriteFile(out_, input_dep); 115 path_output_.WriteFile(out_, input_dep);
116 } 116 }
117 out_ << std::endl; 117 out_ << std::endl;
118 } 118 }
119 } 119 }
OLDNEW
« no previous file with comments | « tools/gn/ninja_action_target_writer.cc ('k') | tools/gn/substitution_type.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698