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

Unified Diff: tools/gn/ninja_copy_target_writer.cc

Issue 387663003: Improve GN handling of directory templates. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months 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/ninja_action_target_writer_unittest.cc ('k') | tools/gn/ninja_copy_target_writer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/ninja_copy_target_writer.cc
diff --git a/tools/gn/ninja_copy_target_writer.cc b/tools/gn/ninja_copy_target_writer.cc
index 06c72df3d32695174ad85c5cd3fa389fe1ee847e..3facd62fe9ab990098a6006d1e4ed46fb158b92b 100644
--- a/tools/gn/ninja_copy_target_writer.cc
+++ b/tools/gn/ninja_copy_target_writer.cc
@@ -19,7 +19,7 @@ NinjaCopyTargetWriter::~NinjaCopyTargetWriter() {
void NinjaCopyTargetWriter::Run() {
CHECK(target_->action_values().outputs().size() == 1);
- FileTemplate output_template(GetOutputTemplate());
+ FileTemplate output_template = FileTemplate::GetForTargetOutputs(target_);
std::vector<OutputFile> output_files;
@@ -35,8 +35,12 @@ void NinjaCopyTargetWriter::Run() {
std::vector<std::string> template_result;
output_template.Apply(input_file, &template_result);
CHECK(template_result.size() == 1);
- OutputFile output_file(template_result[0]);
+ // All output files should be in the build directory, so we can rebase
+ // them just by trimming the prefix.
+ OutputFile output_file(
+ RemovePrefix(template_result[0],
+ settings_->build_settings()->build_dir().value()));
output_files.push_back(output_file);
out_ << "build ";
« no previous file with comments | « tools/gn/ninja_action_target_writer_unittest.cc ('k') | tools/gn/ninja_copy_target_writer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698