| OLD | NEW |
| 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_binary_target_writer.h" | 5 #include "tools/gn/ninja_binary_target_writer.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "tools/gn/config_values_extractors.h" | 10 #include "tools/gn/config_values_extractors.h" |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 NinjaBinaryTargetWriter::NinjaBinaryTargetWriter(const Target* target, | 88 NinjaBinaryTargetWriter::NinjaBinaryTargetWriter(const Target* target, |
| 89 std::ostream& out) | 89 std::ostream& out) |
| 90 : NinjaTargetWriter(target, out), | 90 : NinjaTargetWriter(target, out), |
| 91 tool_type_(GetToolTypeForTarget(target)){ | 91 tool_type_(GetToolTypeForTarget(target)){ |
| 92 } | 92 } |
| 93 | 93 |
| 94 NinjaBinaryTargetWriter::~NinjaBinaryTargetWriter() { | 94 NinjaBinaryTargetWriter::~NinjaBinaryTargetWriter() { |
| 95 } | 95 } |
| 96 | 96 |
| 97 void NinjaBinaryTargetWriter::Run() { | 97 void NinjaBinaryTargetWriter::Run() { |
| 98 WriteEnvironment(); | |
| 99 | |
| 100 WriteCompilerVars(); | 98 WriteCompilerVars(); |
| 101 | 99 |
| 102 std::vector<OutputFile> obj_files; | 100 std::vector<OutputFile> obj_files; |
| 103 WriteSources(&obj_files); | 101 WriteSources(&obj_files); |
| 104 | 102 |
| 105 if (target_->output_type() == Target::SOURCE_SET) | 103 if (target_->output_type() == Target::SOURCE_SET) |
| 106 WriteSourceSetStamp(obj_files); | 104 WriteSourceSetStamp(obj_files); |
| 107 else | 105 else |
| 108 WriteLinkerStuff(obj_files); | 106 WriteLinkerStuff(obj_files); |
| 109 } | 107 } |
| (...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 454 } | 452 } |
| 455 | 453 |
| 456 // Data files. | 454 // Data files. |
| 457 const std::vector<SourceFile>& data = target_->data(); | 455 const std::vector<SourceFile>& data = target_->data(); |
| 458 for (size_t i = 0; i < data.size(); i++) { | 456 for (size_t i = 0; i < data.size(); i++) { |
| 459 out_ << " "; | 457 out_ << " "; |
| 460 path_output_.WriteFile(out_, data[i]); | 458 path_output_.WriteFile(out_, data[i]); |
| 461 } | 459 } |
| 462 } | 460 } |
| 463 } | 461 } |
| OLD | NEW |