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 <algorithm> | 5 #include <algorithm> |
6 #include <set> | 6 #include <set> |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "tools/gn/commands.h" | 10 #include "tools/gn/commands.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 << location.line_number() << ")\n"; | 179 << location.line_number() << ")\n"; |
180 } | 180 } |
181 | 181 |
182 // Templatized writer for writing out different config value types. | 182 // Templatized writer for writing out different config value types. |
183 template<typename T> struct DescValueWriter {}; | 183 template<typename T> struct DescValueWriter {}; |
184 template<> struct DescValueWriter<std::string> { | 184 template<> struct DescValueWriter<std::string> { |
185 void operator()(const std::string& str, std::ostream& out) const { | 185 void operator()(const std::string& str, std::ostream& out) const { |
186 out << " " << str << "\n"; | 186 out << " " << str << "\n"; |
187 } | 187 } |
188 }; | 188 }; |
189 template<> struct DescValueWriter<SourceFile> { | |
190 void operator()(const SourceFile& file, std::ostream& out) const { | |
191 out << " " << file.value() << "\n"; | |
192 } | |
193 }; | |
194 template<> struct DescValueWriter<SourceDir> { | 189 template<> struct DescValueWriter<SourceDir> { |
195 void operator()(const SourceDir& dir, std::ostream& out) const { | 190 void operator()(const SourceDir& dir, std::ostream& out) const { |
196 out << " " << FormatSourceDir(dir) << "\n"; | 191 out << " " << FormatSourceDir(dir) << "\n"; |
197 } | 192 } |
198 }; | 193 }; |
199 | 194 |
200 // Writes a given config value type to the string, optionally with attribution. | 195 // Writes a given config value type to the string, optionally with attribution. |
201 // This should match RecursiveTargetConfigToStream in the order it traverses. | 196 // This should match RecursiveTargetConfigToStream in the order it traverses. |
202 template<typename T> void OutputRecursiveTargetConfig( | 197 template<typename T> void OutputRecursiveTargetConfig( |
203 const Target* target, | 198 const Target* target, |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 OUTPUT_CONFIG_VALUE(ldflags, std::string) | 375 OUTPUT_CONFIG_VALUE(ldflags, std::string) |
381 PrintLibs(target, true); | 376 PrintLibs(target, true); |
382 PrintLibDirs(target, true); | 377 PrintLibDirs(target, true); |
383 | 378 |
384 PrintDeps(target, true); | 379 PrintDeps(target, true); |
385 | 380 |
386 return 0; | 381 return 0; |
387 } | 382 } |
388 | 383 |
389 } // namespace commands | 384 } // namespace commands |
OLD | NEW |