| Index: tools/gn/path_output.cc
|
| diff --git a/tools/gn/path_output.cc b/tools/gn/path_output.cc
|
| index de398ec20f74b9894d3062813cff36dcda73454d..7ae5c9d1b947dd336ce98f4cf4738ecedd8d040b 100644
|
| --- a/tools/gn/path_output.cc
|
| +++ b/tools/gn/path_output.cc
|
| @@ -4,19 +4,19 @@
|
|
|
| #include "tools/gn/path_output.h"
|
|
|
| +#include "base/strings/string_util.h"
|
| #include "build/build_config.h"
|
| #include "tools/gn/filesystem_utils.h"
|
| #include "tools/gn/output_file.h"
|
| #include "tools/gn/string_utils.h"
|
|
|
| -PathOutput::PathOutput(const SourceDir& current_dir, EscapingMode escaping)
|
| +PathOutput::PathOutput(const SourceDir& current_dir,
|
| + const base::FilePath& source_root, EscapingMode escaping)
|
| : current_dir_(current_dir) {
|
| - CHECK(current_dir.is_source_absolute())
|
| - << "Currently this only supports writing to output directories inside "
|
| - "the source root. There needs to be some tweaks to PathOutput to make "
|
| - "doing this work correctly.";
|
| - inverse_current_dir_ = InvertDir(current_dir_);
|
| -
|
| + inverse_current_dir_ =
|
| + RebaseSourceAbsolutePath("//", current_dir, source_root);
|
| + if (!EndsWithSlash(inverse_current_dir_))
|
| + inverse_current_dir_.push_back('/');
|
| options_.mode = escaping;
|
| }
|
|
|
|
|