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 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 void NinjaTargetWriter::WriteSharedVars(const SubstitutionBits& bits) { | 97 void NinjaTargetWriter::WriteSharedVars(const SubstitutionBits& bits) { |
98 bool written_anything = false; | 98 bool written_anything = false; |
99 | 99 |
100 // Target label. | 100 // Target label. |
101 if (bits.used[SUBSTITUTION_LABEL]) { | 101 if (bits.used[SUBSTITUTION_LABEL]) { |
102 WriteEscapedSubstitution(SUBSTITUTION_LABEL); | 102 WriteEscapedSubstitution(SUBSTITUTION_LABEL); |
103 written_anything = true; | 103 written_anything = true; |
104 } | 104 } |
105 | 105 |
| 106 // Target label name |
| 107 if (bits.used[SUBSTITUTION_LABEL_NAME]) { |
| 108 WriteEscapedSubstitution(SUBSTITUTION_LABEL_NAME); |
| 109 written_anything = true; |
| 110 } |
| 111 |
106 // Root gen dir. | 112 // Root gen dir. |
107 if (bits.used[SUBSTITUTION_ROOT_GEN_DIR]) { | 113 if (bits.used[SUBSTITUTION_ROOT_GEN_DIR]) { |
108 WriteEscapedSubstitution(SUBSTITUTION_ROOT_GEN_DIR); | 114 WriteEscapedSubstitution(SUBSTITUTION_ROOT_GEN_DIR); |
109 written_anything = true; | 115 written_anything = true; |
110 } | 116 } |
111 | 117 |
112 // Root out dir. | 118 // Root out dir. |
113 if (bits.used[SUBSTITUTION_ROOT_OUT_DIR]) { | 119 if (bits.used[SUBSTITUTION_ROOT_OUT_DIR]) { |
114 WriteEscapedSubstitution(SUBSTITUTION_ROOT_OUT_DIR); | 120 WriteEscapedSubstitution(SUBSTITUTION_ROOT_OUT_DIR); |
115 written_anything = true; | 121 written_anything = true; |
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 << GetNinjaRulePrefixForToolchain(settings_) | 255 << GetNinjaRulePrefixForToolchain(settings_) |
250 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); | 256 << Toolchain::ToolTypeToName(Toolchain::TYPE_STAMP); |
251 path_output_.WriteFiles(out_, files); | 257 path_output_.WriteFiles(out_, files); |
252 | 258 |
253 if (!order_only_deps.empty()) { | 259 if (!order_only_deps.empty()) { |
254 out_ << " ||"; | 260 out_ << " ||"; |
255 path_output_.WriteFiles(out_, order_only_deps); | 261 path_output_.WriteFiles(out_, order_only_deps); |
256 } | 262 } |
257 out_ << std::endl; | 263 out_ << std::endl; |
258 } | 264 } |
OLD | NEW |