OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_bundle_data_target_writer.h" | 5 #include "tools/gn/ninja_bundle_data_target_writer.h" |
6 | 6 |
7 #include "tools/gn/output_file.h" | 7 #include "tools/gn/output_file.h" |
| 8 #include "tools/gn/settings.h" |
| 9 #include "tools/gn/target.h" |
8 | 10 |
9 NinjaBundleDataTargetWriter::NinjaBundleDataTargetWriter(const Target* target, | 11 NinjaBundleDataTargetWriter::NinjaBundleDataTargetWriter(const Target* target, |
10 std::ostream& out) | 12 std::ostream& out) |
11 : NinjaTargetWriter(target, out) {} | 13 : NinjaTargetWriter(target, out) {} |
12 | 14 |
13 NinjaBundleDataTargetWriter::~NinjaBundleDataTargetWriter() {} | 15 NinjaBundleDataTargetWriter::~NinjaBundleDataTargetWriter() {} |
14 | 16 |
15 void NinjaBundleDataTargetWriter::Run() { | 17 void NinjaBundleDataTargetWriter::Run() { |
16 std::vector<OutputFile> files; | 18 std::vector<OutputFile> output_files; |
17 files.push_back(WriteInputDepsStampAndGetDep(std::vector<const Target*>())); | 19 for (const SourceFile& source_file : target_->sources()) { |
18 WriteStampForTarget(files, std::vector<OutputFile>()); | 20 output_files.push_back( |
| 21 OutputFile(settings_->build_settings(), source_file)); |
| 22 } |
| 23 |
| 24 std::vector<const Target*> extra_hard_deps; |
| 25 OutputFile input_dep = WriteInputDepsStampAndGetDep(extra_hard_deps); |
| 26 if (!input_dep.value().empty()) |
| 27 output_files.push_back(input_dep); |
| 28 |
| 29 std::vector<OutputFile> order_only_deps; |
| 30 for (const auto& pair : target_->data_deps()) |
| 31 order_only_deps.push_back(pair.ptr->dependency_output_file()); |
| 32 |
| 33 WriteStampForTarget(output_files, order_only_deps); |
19 } | 34 } |
OLD | NEW |