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

Side by Side Diff: tools/gn/ninja_target_writer.cc

Issue 26267003: Add the concept of a source set to GN. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « tools/gn/ninja_script_target_writer_unittest.cc ('k') | tools/gn/output_file.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "tools/gn/ninja_target_writer.h" 5 #include "tools/gn/ninja_target_writer.h"
6 6
7 #include <fstream> 7 #include <fstream>
8 #include <sstream> 8 #include <sstream>
9 9
10 #include "base/file_util.h" 10 #include "base/file_util.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 NinjaCopyTargetWriter writer(target, file); 72 NinjaCopyTargetWriter writer(target, file);
73 writer.Run(); 73 writer.Run();
74 } else if (target->output_type() == Target::CUSTOM) { 74 } else if (target->output_type() == Target::CUSTOM) {
75 NinjaScriptTargetWriter writer(target, file); 75 NinjaScriptTargetWriter writer(target, file);
76 writer.Run(); 76 writer.Run();
77 } else if (target->output_type() == Target::GROUP) { 77 } else if (target->output_type() == Target::GROUP) {
78 NinjaGroupTargetWriter writer(target, file); 78 NinjaGroupTargetWriter writer(target, file);
79 writer.Run(); 79 writer.Run();
80 } else if (target->output_type() == Target::EXECUTABLE || 80 } else if (target->output_type() == Target::EXECUTABLE ||
81 target->output_type() == Target::STATIC_LIBRARY || 81 target->output_type() == Target::STATIC_LIBRARY ||
82 target->output_type() == Target::SHARED_LIBRARY) { 82 target->output_type() == Target::SHARED_LIBRARY ||
83 target->output_type() == Target::SOURCE_SET) {
83 NinjaBinaryTargetWriter writer(target, file); 84 NinjaBinaryTargetWriter writer(target, file);
84 writer.Run(); 85 writer.Run();
85 } else { 86 } else {
86 CHECK(0); 87 CHECK(0);
87 } 88 }
88 89
89 std::string contents = file.str(); 90 std::string contents = file.str();
90 file_util::WriteFile(ninja_file, contents.c_str(), 91 file_util::WriteFile(ninja_file, contents.c_str(),
91 static_cast<int>(contents.size())); 92 static_cast<int>(contents.size()));
92 } 93 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 const Target::FileList& outputs = target_->script_values().outputs(); 133 const Target::FileList& outputs = target_->script_values().outputs();
133 std::vector<std::string> output_template_args; 134 std::vector<std::string> output_template_args;
134 for (size_t i = 0; i < outputs.size(); i++) { 135 for (size_t i = 0; i < outputs.size(); i++) {
135 // All outputs should be in the output dir. 136 // All outputs should be in the output dir.
136 output_template_args.push_back( 137 output_template_args.push_back(
137 RemovePrefix(outputs[i].value(), 138 RemovePrefix(outputs[i].value(),
138 settings_->build_settings()->build_dir().value())); 139 settings_->build_settings()->build_dir().value()));
139 } 140 }
140 return FileTemplate(output_template_args); 141 return FileTemplate(output_template_args);
141 } 142 }
OLDNEW
« no previous file with comments | « tools/gn/ninja_script_target_writer_unittest.cc ('k') | tools/gn/output_file.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698