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_target_writer.h" | 5 #include "tools/gn/ninja_target_writer.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 out_ << " "; | 248 out_ << " "; |
249 path_output_.WriteFile(out_, *source); | 249 path_output_.WriteFile(out_, *source); |
250 } | 250 } |
251 | 251 |
252 // Target input deps. Sort by label so the output is deterministic (otherwise | 252 // Target input deps. Sort by label so the output is deterministic (otherwise |
253 // some of the targets will have gone through std::sets which will have | 253 // some of the targets will have gone through std::sets which will have |
254 // sorted them by pointer). | 254 // sorted them by pointer). |
255 std::sort( | 255 std::sort( |
256 input_deps_targets.begin(), input_deps_targets.end(), | 256 input_deps_targets.begin(), input_deps_targets.end(), |
257 [](const Target* a, const Target* b) { return a->label() < b->label(); }); | 257 [](const Target* a, const Target* b) { return a->label() < b->label(); }); |
258 for (const auto& dep : input_deps_targets) { | 258 for (auto* dep : input_deps_targets) { |
259 DCHECK(!dep->dependency_output_file().value().empty()); | 259 DCHECK(!dep->dependency_output_file().value().empty()); |
260 out_ << " "; | 260 out_ << " "; |
261 path_output_.WriteFile(out_, dep->dependency_output_file()); | 261 path_output_.WriteFile(out_, dep->dependency_output_file()); |
262 } | 262 } |
263 | 263 |
264 out_ << "\n"; | 264 out_ << "\n"; |
265 return input_stamp_file; | 265 return input_stamp_file; |
266 } | 266 } |
267 | 267 |
268 void NinjaTargetWriter::WriteStampForTarget( | 268 void NinjaTargetWriter::WriteStampForTarget( |
(...skipping 15 matching lines...) Expand all Loading... |
284 << GetNinjaRulePrefixForToolchain(settings_) | 284 << GetNinjaRulePrefixForToolchain(settings_) |
285 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); | 285 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); |
286 path_output_.WriteFiles(out_, files); | 286 path_output_.WriteFiles(out_, files); |
287 | 287 |
288 if (!order_only_deps.empty()) { | 288 if (!order_only_deps.empty()) { |
289 out_ << " ||"; | 289 out_ << " ||"; |
290 path_output_.WriteFiles(out_, order_only_deps); | 290 path_output_.WriteFiles(out_, order_only_deps); |
291 } | 291 } |
292 out_ << std::endl; | 292 out_ << std::endl; |
293 } | 293 } |
OLD | NEW |