| 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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 255 // of writing a stamp file for it. | 255 // of writing a stamp file for it. |
| 256 if (input_deps_sources.size() == 1 && input_deps_targets.size() == 0) | 256 if (input_deps_sources.size() == 1 && input_deps_targets.size() == 0) |
| 257 return OutputFile(settings_->build_settings(), *input_deps_sources[0]); | 257 return OutputFile(settings_->build_settings(), *input_deps_sources[0]); |
| 258 if (input_deps_sources.size() == 0 && input_deps_targets.size() == 1) { | 258 if (input_deps_sources.size() == 0 && input_deps_targets.size() == 1) { |
| 259 const OutputFile& dep = input_deps_targets[0]->dependency_output_file(); | 259 const OutputFile& dep = input_deps_targets[0]->dependency_output_file(); |
| 260 DCHECK(!dep.value().empty()); | 260 DCHECK(!dep.value().empty()); |
| 261 return dep; | 261 return dep; |
| 262 } | 262 } |
| 263 | 263 |
| 264 // Make a stamp file. | 264 // Make a stamp file. |
| 265 OutputFile input_stamp_file( | 265 OutputFile input_stamp_file = |
| 266 RebasePath(GetTargetOutputDir(target_).value(), | 266 GetBuildDirForTargetAsOutputFile(target_, BuildDirType::OBJ); |
| 267 settings_->build_settings()->build_dir(), | |
| 268 settings_->build_settings()->root_path_utf8())); | |
| 269 input_stamp_file.value().append(target_->label().name()); | 267 input_stamp_file.value().append(target_->label().name()); |
| 270 input_stamp_file.value().append(".inputdeps.stamp"); | 268 input_stamp_file.value().append(".inputdeps.stamp"); |
| 271 | 269 |
| 272 out_ << "build "; | 270 out_ << "build "; |
| 273 path_output_.WriteFile(out_, input_stamp_file); | 271 path_output_.WriteFile(out_, input_stamp_file); |
| 274 out_ << ": " | 272 out_ << ": " |
| 275 << GetNinjaRulePrefixForToolchain(settings_) | 273 << GetNinjaRulePrefixForToolchain(settings_) |
| 276 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); | 274 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); |
| 277 | 275 |
| 278 // File input deps. | 276 // File input deps. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 << GetNinjaRulePrefixForToolchain(settings_) | 314 << GetNinjaRulePrefixForToolchain(settings_) |
| 317 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); | 315 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); |
| 318 path_output_.WriteFiles(out_, files); | 316 path_output_.WriteFiles(out_, files); |
| 319 | 317 |
| 320 if (!order_only_deps.empty()) { | 318 if (!order_only_deps.empty()) { |
| 321 out_ << " ||"; | 319 out_ << " ||"; |
| 322 path_output_.WriteFiles(out_, order_only_deps); | 320 path_output_.WriteFiles(out_, order_only_deps); |
| 323 } | 321 } |
| 324 out_ << std::endl; | 322 out_ << std::endl; |
| 325 } | 323 } |
| OLD | NEW |