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 "base/strings/string_util.h" | 7 #include "base/strings/string_util.h" |
8 #include "tools/gn/err.h" | 8 #include "tools/gn/err.h" |
9 #include "tools/gn/file_template.h" | 9 #include "tools/gn/file_template.h" |
10 #include "tools/gn/string_utils.h" | 10 #include "tools/gn/string_utils.h" |
11 #include "tools/gn/target.h" | 11 #include "tools/gn/target.h" |
12 | 12 |
13 NinjaActionTargetWriter::NinjaActionTargetWriter(const Target* target, | 13 NinjaActionTargetWriter::NinjaActionTargetWriter(const Target* target, |
14 const Toolchain* toolchain, | 14 const Toolchain* toolchain, |
15 std::ostream& out) | 15 std::ostream& out) |
16 : NinjaTargetWriter(target, toolchain, out), | 16 : NinjaTargetWriter(target, toolchain, out), |
17 path_output_no_escaping_( | 17 path_output_no_escaping_( |
18 target->settings()->build_settings()->build_dir(), | 18 target->settings()->build_settings()->build_dir(), ESCAPE_NONE) { |
19 ESCAPE_NONE, false) { | |
20 } | 19 } |
21 | 20 |
22 NinjaActionTargetWriter::~NinjaActionTargetWriter() { | 21 NinjaActionTargetWriter::~NinjaActionTargetWriter() { |
23 } | 22 } |
24 | 23 |
25 void NinjaActionTargetWriter::Run() { | 24 void NinjaActionTargetWriter::Run() { |
26 FileTemplate args_template(target_->action_values().args()); | 25 FileTemplate args_template(target_->action_values().args()); |
27 std::string custom_rule_name = WriteRuleDefinition(args_template); | 26 std::string custom_rule_name = WriteRuleDefinition(args_template); |
28 std::string implicit_deps = GetSourcesImplicitDeps(); | 27 std::string implicit_deps = GetSourcesImplicitDeps(); |
29 | 28 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 } | 218 } |
220 | 219 |
221 FileTemplate NinjaActionTargetWriter::GetDepfileTemplate() const { | 220 FileTemplate NinjaActionTargetWriter::GetDepfileTemplate() const { |
222 std::vector<std::string> template_args; | 221 std::vector<std::string> template_args; |
223 std::string depfile_relative_to_build_dir = | 222 std::string depfile_relative_to_build_dir = |
224 RemovePrefix(target_->action_values().depfile().value(), | 223 RemovePrefix(target_->action_values().depfile().value(), |
225 settings_->build_settings()->build_dir().value()); | 224 settings_->build_settings()->build_dir().value()); |
226 template_args.push_back(depfile_relative_to_build_dir); | 225 template_args.push_back(depfile_relative_to_build_dir); |
227 return FileTemplate(template_args); | 226 return FileTemplate(template_args); |
228 } | 227 } |
OLD | NEW |