// Copyright (c) 2013 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include #include #include #include "base/command_line.h" #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/label.h" #include "tools/gn/setup.h" #include "tools/gn/standard_out.h" #include "tools/gn/target.h" 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