Chromium Code Reviews| Index: tools/gn/path_output.cc |
| diff --git a/tools/gn/path_output.cc b/tools/gn/path_output.cc |
| index de398ec20f74b9894d3062813cff36dcda73454d..2c9c2f3beae556298053bdf002f9052dfe4993c2 100644 |
| --- a/tools/gn/path_output.cc |
| +++ b/tools/gn/path_output.cc |
| @@ -4,19 +4,20 @@ |
| #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::StringPiece& 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_)) |
|
brettw
2014/11/05 19:59:49
I would hope that the above operation is always th
zeuthen
2014/11/07 19:24:12
I tried adding a DHCECK() and it fails is in the P
|
| + inverse_current_dir_.push_back('/'); |
| options_.mode = escaping; |
| } |