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/ninja_action_target_writer.h" | 5 #include "tools/gn/ninja_action_target_writer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "tools/gn/deps_iterator.h" | 10 #include "tools/gn/deps_iterator.h" |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 path_output_.WriteFile(out_, input_dep); | 173 path_output_.WriteFile(out_, input_dep); |
174 } | 174 } |
175 out_ << std::endl; | 175 out_ << std::endl; |
176 | 176 |
177 // Response files require a unique name be defined. | 177 // Response files require a unique name be defined. |
178 if (target_->action_values().uses_rsp_file()) | 178 if (target_->action_values().uses_rsp_file()) |
179 out_ << " unique_name = " << i << std::endl; | 179 out_ << " unique_name = " << i << std::endl; |
180 | 180 |
181 // The required types is the union of the args and response file. This | 181 // The required types is the union of the args and response file. This |
182 // might theoretically duplicate a definition if the same substitution is | 182 // might theoretically duplicate a definition if the same substitution is |
183 // used in both the args and the reponse file. However, this should be | 183 // used in both the args and the response file. However, this should be |
184 // very unusual (normally the substitutions will go in one place or the | 184 // very unusual (normally the substitutions will go in one place or the |
185 // other) and the redundant assignment won't bother Ninja. | 185 // other) and the redundant assignment won't bother Ninja. |
186 SubstitutionWriter::WriteNinjaVariablesForSource( | 186 SubstitutionWriter::WriteNinjaVariablesForSource( |
187 target_, settings_, sources[i], | 187 target_, settings_, sources[i], |
188 target_->action_values().args().required_types(), | 188 target_->action_values().args().required_types(), |
189 args_escape_options, out_); | 189 args_escape_options, out_); |
190 SubstitutionWriter::WriteNinjaVariablesForSource( | 190 SubstitutionWriter::WriteNinjaVariablesForSource( |
191 target_, settings_, sources[i], | 191 target_, settings_, sources[i], |
192 target_->action_values().rsp_file_contents().required_types(), | 192 target_->action_values().rsp_file_contents().required_types(), |
193 args_escape_options, out_); | 193 args_escape_options, out_); |
(...skipping 19 matching lines...) Expand all Loading... |
213 out_ << " "; | 213 out_ << " "; |
214 path_output_.WriteFile(out_, (*output_files)[i]); | 214 path_output_.WriteFile(out_, (*output_files)[i]); |
215 } | 215 } |
216 } | 216 } |
217 | 217 |
218 void NinjaActionTargetWriter::WriteDepfile(const SourceFile& source) { | 218 void NinjaActionTargetWriter::WriteDepfile(const SourceFile& source) { |
219 path_output_.WriteFile(out_, | 219 path_output_.WriteFile(out_, |
220 SubstitutionWriter::ApplyPatternToSourceAsOutputFile( | 220 SubstitutionWriter::ApplyPatternToSourceAsOutputFile( |
221 target_, settings_, target_->action_values().depfile(), source)); | 221 target_, settings_, target_->action_values().depfile(), source)); |
222 } | 222 } |
OLD | NEW |