Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Unified Diff: tools/gn/command_desc.cc

Issue 56433003: GN threading refactor (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tools/gn/builder_unittest.cc ('k') | tools/gn/command_gen.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/command_desc.cc
diff --git a/tools/gn/command_desc.cc b/tools/gn/command_desc.cc
index 415666ca53367e4271e835497d12b4efb64193f8..f680da38ed5abd02c7a8e4c129c9d3b93248ebd1 100644
--- a/tools/gn/command_desc.cc
+++ b/tools/gn/command_desc.cc
@@ -10,8 +10,8 @@
#include "tools/gn/commands.h"
#include "tools/gn/config.h"
#include "tools/gn/config_values_extractors.h"
+#include "tools/gn/filesystem_utils.h"
#include "tools/gn/item.h"
-#include "tools/gn/item_node.h"
#include "tools/gn/label.h"
#include "tools/gn/setup.h"
#include "tools/gn/standard_out.h"
@@ -21,6 +21,23 @@ namespace commands {
namespace {
+// Prints the given directory in a nice way for the user to view.
+std::string FormatSourceDir(const SourceDir& dir) {
+#if defined(OS_WIN)
+ // On Windows we fix up system absolute paths to look like native ones.
+ // Internally, they'll look like "/C:\foo\bar/"
+ if (dir.is_system_absolute()) {
+ std::string buf = dir.value();
+ if (buf.size() > 3 && buf[2] == ':') {
+ buf.erase(buf.begin()); // Erase beginning slash.
+ ConvertPathToSystem(&buf); // Convert to backslashes.
+ return buf;
+ }
+ }
+#endif
+ return dir.value();
+}
+
void RecursiveCollectChildDeps(const Target* target, std::set<Label>* result);
void RecursiveCollectDeps(const Target* target, std::set<Label>* result) {
@@ -114,7 +131,7 @@ void PrintLibDirs(const Target* target, bool display_header) {
OutputString("\nlib_dirs\n");
for (size_t i = 0; i < lib_dirs.size(); i++)
- OutputString(" " + lib_dirs[i].value() + "\n");
+ OutputString(" " + FormatSourceDir(lib_dirs[i]) + "\n");
}
void PrintLibs(const Target* target, bool display_header) {
@@ -176,7 +193,7 @@ template<> struct DescValueWriter<SourceFile> {
};
template<> struct DescValueWriter<SourceDir> {
void operator()(const SourceDir& dir, std::ostream& out) const {
- out << " " << dir.value() << "\n";
+ out << " " << FormatSourceDir(dir) << "\n";
}
};
« no previous file with comments | « tools/gn/builder_unittest.cc ('k') | tools/gn/command_gen.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698