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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 return input_stamp_file; | 235 return input_stamp_file; |
236 } | 236 } |
237 | 237 |
238 void NinjaTargetWriter::WriteStampForTarget( | 238 void NinjaTargetWriter::WriteStampForTarget( |
239 const std::vector<OutputFile>& files, | 239 const std::vector<OutputFile>& files, |
240 const std::vector<OutputFile>& order_only_deps) { | 240 const std::vector<OutputFile>& order_only_deps) { |
241 const OutputFile& stamp_file = target_->dependency_output_file(); | 241 const OutputFile& stamp_file = target_->dependency_output_file(); |
242 | 242 |
243 // First validate that the target's dependency is a stamp file. Otherwise, | 243 // First validate that the target's dependency is a stamp file. Otherwise, |
244 // we shouldn't have gotten here! | 244 // we shouldn't have gotten here! |
245 CHECK(base::EndsWith(stamp_file.value(), ".stamp", false)) | 245 CHECK(base::EndsWith(stamp_file.value(), ".stamp", |
| 246 base::CompareCase::INSENSITIVE_ASCII)) |
246 << "Output should end in \".stamp\" for stamp file output. Instead got: " | 247 << "Output should end in \".stamp\" for stamp file output. Instead got: " |
247 << "\"" << stamp_file.value() << "\""; | 248 << "\"" << stamp_file.value() << "\""; |
248 | 249 |
249 out_ << "build "; | 250 out_ << "build "; |
250 path_output_.WriteFile(out_, stamp_file); | 251 path_output_.WriteFile(out_, stamp_file); |
251 | 252 |
252 out_ << ": " | 253 out_ << ": " |
253 << GetNinjaRulePrefixForToolchain(settings_) | 254 << GetNinjaRulePrefixForToolchain(settings_) |
254 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); | 255 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); |
255 path_output_.WriteFiles(out_, files); | 256 path_output_.WriteFiles(out_, files); |
256 | 257 |
257 if (!order_only_deps.empty()) { | 258 if (!order_only_deps.empty()) { |
258 out_ << " ||"; | 259 out_ << " ||"; |
259 path_output_.WriteFiles(out_, order_only_deps); | 260 path_output_.WriteFiles(out_, order_only_deps); |
260 } | 261 } |
261 out_ << std::endl; | 262 out_ << std::endl; |
262 } | 263 } |
OLD | NEW |