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

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: 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
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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 // does not include the dot but the tool's does. 549 // does not include the dot but the tool's does.
548 if (target->output_extension().empty()) 550 if (target->output_extension().empty())
549 return tool->default_output_extension(); 551 return tool->default_output_extension();
550 return std::string(".") + target->output_extension(); 552 return std::string(".") + target->output_extension();
551 553
552 default: 554 default:
553 NOTREACHED(); 555 NOTREACHED();
554 return std::string(); 556 return std::string();
555 } 557 }
556 } 558 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698