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_build_writer.h" | 5 #include "tools/gn/ninja_build_writer.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <fstream> | 9 #include <fstream> |
10 #include <map> | 10 #include <map> |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 std::set<base::FilePath> fileset(input_files.begin(), input_files.end()); | 247 std::set<base::FilePath> fileset(input_files.begin(), input_files.end()); |
248 fileset.insert(other_files.begin(), other_files.end()); | 248 fileset.insert(other_files.begin(), other_files.end()); |
249 | 249 |
250 for (const auto& other_file : fileset) | 250 for (const auto& other_file : fileset) |
251 dep_out_ << " " << FilePathToUTF8(other_file); | 251 dep_out_ << " " << FilePathToUTF8(other_file); |
252 | 252 |
253 out_ << std::endl; | 253 out_ << std::endl; |
254 } | 254 } |
255 | 255 |
256 void NinjaBuildWriter::WriteAllPools() { | 256 void NinjaBuildWriter::WriteAllPools() { |
257 out_ << "pool link_pool\n" | |
258 << " depth = " << default_toolchain_->concurrent_links() << std::endl | |
259 << std::endl; | |
260 | |
261 // Compute the pools referenced by all tools of all used toolchains. | 257 // Compute the pools referenced by all tools of all used toolchains. |
262 std::set<const Pool*> used_pools; | 258 std::set<const Pool*> used_pools; |
263 for (const auto& pair : used_toolchains_) { | 259 for (const auto& pair : used_toolchains_) { |
264 for (int j = Toolchain::TYPE_NONE + 1; j < Toolchain::TYPE_NUMTYPES; j++) { | 260 for (int j = Toolchain::TYPE_NONE + 1; j < Toolchain::TYPE_NUMTYPES; j++) { |
265 Toolchain::ToolType tool_type = static_cast<Toolchain::ToolType>(j); | 261 Toolchain::ToolType tool_type = static_cast<Toolchain::ToolType>(j); |
266 const Tool* tool = pair.second->GetTool(tool_type); | 262 const Tool* tool = pair.second->GetTool(tool_type); |
267 if (tool && tool->pool().ptr) | 263 if (tool && tool->pool().ptr) |
268 used_pools.insert(tool->pool().ptr); | 264 used_pools.insert(tool->pool().ptr); |
269 } | 265 } |
270 } | 266 } |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
450 EscapeOptions ninja_escape; | 446 EscapeOptions ninja_escape; |
451 ninja_escape.mode = ESCAPE_NINJA; | 447 ninja_escape.mode = ESCAPE_NINJA; |
452 | 448 |
453 // Escape for special chars Ninja will handle. | 449 // Escape for special chars Ninja will handle. |
454 std::string escaped = EscapeString(phony_name, ninja_escape, nullptr); | 450 std::string escaped = EscapeString(phony_name, ninja_escape, nullptr); |
455 | 451 |
456 out_ << "build " << escaped << ": phony "; | 452 out_ << "build " << escaped << ": phony "; |
457 path_output_.WriteFile(out_, target->dependency_output_file()); | 453 path_output_.WriteFile(out_, target->dependency_output_file()); |
458 out_ << std::endl; | 454 out_ << std::endl; |
459 } | 455 } |
OLD | NEW |