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

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

Issue 1430043002: Support script response files in GN. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: review comment, random build fix Created 5 years, 1 month 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
« no previous file with comments | « tools/gn/substitution_type.cc ('k') | tools/gn/variables.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/substitution_writer.h" 5 #include "tools/gn/substitution_writer.h"
6 6
7 #include "tools/gn/build_settings.h" 7 #include "tools/gn/build_settings.h"
8 #include "tools/gn/escape.h" 8 #include "tools/gn/escape.h"
9 #include "tools/gn/filesystem_utils.h" 9 #include "tools/gn/filesystem_utils.h"
10 #include "tools/gn/output_file.h" 10 #include "tools/gn/output_file.h"
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
303 303
304 // static 304 // static
305 void SubstitutionWriter::WriteNinjaVariablesForSource( 305 void SubstitutionWriter::WriteNinjaVariablesForSource(
306 const Settings* settings, 306 const Settings* settings,
307 const SourceFile& source, 307 const SourceFile& source,
308 const std::vector<SubstitutionType>& types, 308 const std::vector<SubstitutionType>& types,
309 const EscapeOptions& escape_options, 309 const EscapeOptions& escape_options,
310 std::ostream& out) { 310 std::ostream& out) {
311 for (const auto& type : types) { 311 for (const auto& type : types) {
312 // Don't write SOURCE since that just maps to Ninja's $in variable, which 312 // Don't write SOURCE since that just maps to Ninja's $in variable, which
313 // is implicit in the rule. 313 // is implicit in the rule. RESPONSE_FILE_NAME is written separately
314 if (type != SUBSTITUTION_SOURCE) { 314 // only when writing target rules since it can never be used in any
315 // other context (like process_file_template).
316 if (type != SUBSTITUTION_SOURCE && type != SUBSTITUTION_RSP_FILE_NAME) {
315 out << " " << kSubstitutionNinjaNames[type] << " = "; 317 out << " " << kSubstitutionNinjaNames[type] << " = ";
316 EscapeStringToStream( 318 EscapeStringToStream(
317 out, 319 out,
318 GetSourceSubstitution(settings, source, type, OUTPUT_RELATIVE, 320 GetSourceSubstitution(settings, source, type, OUTPUT_RELATIVE,
319 settings->build_settings()->build_dir()), 321 settings->build_settings()->build_dir()),
320 escape_options); 322 escape_options);
321 out << std::endl; 323 out << std::endl;
322 } 324 }
323 } 325 }
324 } 326 }
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
550 // does not include the dot but the tool's does. 552 // does not include the dot but the tool's does.
551 if (target->output_extension().empty()) 553 if (target->output_extension().empty())
552 return tool->default_output_extension(); 554 return tool->default_output_extension();
553 return std::string(".") + target->output_extension(); 555 return std::string(".") + target->output_extension();
554 556
555 default: 557 default:
556 NOTREACHED(); 558 NOTREACHED();
557 return std::string(); 559 return std::string();
558 } 560 }
559 } 561 }
OLDNEW
« no previous file with comments | « tools/gn/substitution_type.cc ('k') | tools/gn/variables.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698