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 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 | 235 |
236 for (const Pool* pool : all_pools_) { | 236 for (const Pool* pool : all_pools_) { |
237 std::string pool_name = pool->GetNinjaName(default_toolchain_->label()); | 237 std::string pool_name = pool->GetNinjaName(default_toolchain_->label()); |
238 out_ << "pool " << pool_name << std::endl | 238 out_ << "pool " << pool_name << std::endl |
239 << " depth = " << pool->depth() << std::endl | 239 << " depth = " << pool->depth() << std::endl |
240 << std::endl; | 240 << std::endl; |
241 } | 241 } |
242 } | 242 } |
243 | 243 |
244 void NinjaBuildWriter::WriteSubninjas() { | 244 void NinjaBuildWriter::WriteSubninjas() { |
245 for (const auto& elem : all_settings_) { | 245 for (auto* elem : all_settings_) { |
246 out_ << "subninja "; | 246 out_ << "subninja "; |
247 path_output_.WriteFile(out_, GetNinjaFileForToolchain(elem)); | 247 path_output_.WriteFile(out_, GetNinjaFileForToolchain(elem)); |
248 out_ << std::endl; | 248 out_ << std::endl; |
249 } | 249 } |
250 out_ << std::endl; | 250 out_ << std::endl; |
251 } | 251 } |
252 | 252 |
253 bool NinjaBuildWriter::WritePhonyAndAllRules(Err* err) { | 253 bool NinjaBuildWriter::WritePhonyAndAllRules(Err* err) { |
254 // Track rules as we generate them so we don't accidentally write a phony | 254 // Track rules as we generate them so we don't accidentally write a phony |
255 // rule that collides with something else. | 255 // rule that collides with something else. |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
414 EscapeOptions ninja_escape; | 414 EscapeOptions ninja_escape; |
415 ninja_escape.mode = ESCAPE_NINJA; | 415 ninja_escape.mode = ESCAPE_NINJA; |
416 | 416 |
417 // Escape for special chars Ninja will handle. | 417 // Escape for special chars Ninja will handle. |
418 std::string escaped = EscapeString(phony_name, ninja_escape, nullptr); | 418 std::string escaped = EscapeString(phony_name, ninja_escape, nullptr); |
419 | 419 |
420 out_ << "build " << escaped << ": phony "; | 420 out_ << "build " << escaped << ": phony "; |
421 path_output_.WriteFile(out_, target->dependency_output_file()); | 421 path_output_.WriteFile(out_, target->dependency_output_file()); |
422 out_ << std::endl; | 422 out_ << std::endl; |
423 } | 423 } |
OLD | NEW |