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_toolchain_writer.h" | 5 #include "tools/gn/ninja_toolchain_writer.h" |
6 | 6 |
7 #include <fstream> | 7 #include <fstream> |
8 | 8 |
9 #include "base/files/file_util.h" | 9 #include "base/files/file_util.h" |
10 #include "base/strings/stringize_macros.h" | 10 #include "base/strings/stringize_macros.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 } else if (tool->depsformat() == Tool::DEPS_MSVC) { | 103 } else if (tool->depsformat() == Tool::DEPS_MSVC) { |
104 // MSVC deps don't have a depfile. | 104 // MSVC deps don't have a depfile. |
105 out_ << kIndent << "deps = msvc" << std::endl; | 105 out_ << kIndent << "deps = msvc" << std::endl; |
106 } | 106 } |
107 | 107 |
108 // Use pool is specified. | 108 // Use pool is specified. |
109 if (tool->pool().ptr) { | 109 if (tool->pool().ptr) { |
110 std::string pool_name = | 110 std::string pool_name = |
111 tool->pool().ptr->GetNinjaName(settings_->default_toolchain_label()); | 111 tool->pool().ptr->GetNinjaName(settings_->default_toolchain_label()); |
112 out_ << kIndent << "pool = " << pool_name << std::endl; | 112 out_ << kIndent << "pool = " << pool_name << std::endl; |
113 } else if (type == Toolchain::TYPE_SOLINK || | |
114 type == Toolchain::TYPE_SOLINK_MODULE || | |
115 type == Toolchain::TYPE_LINK) { | |
116 // The link pool applies to linker tools. Don't count TYPE_ALINK since | |
117 // static libraries are not generally intensive to write. | |
118 out_ << kIndent << "pool = link_pool\n"; | |
119 } | 113 } |
120 | 114 |
121 if (tool->restat()) | 115 if (tool->restat()) |
122 out_ << kIndent << "restat = 1" << std::endl; | 116 out_ << kIndent << "restat = 1" << std::endl; |
123 } | 117 } |
124 | 118 |
125 void NinjaToolchainWriter::WriteRulePattern(const char* name, | 119 void NinjaToolchainWriter::WriteRulePattern(const char* name, |
126 const SubstitutionPattern& pattern, | 120 const SubstitutionPattern& pattern, |
127 const EscapeOptions& options) { | 121 const EscapeOptions& options) { |
128 if (pattern.empty()) | 122 if (pattern.empty()) |
129 return; | 123 return; |
130 out_ << kIndent << name << " = "; | 124 out_ << kIndent << name << " = "; |
131 SubstitutionWriter::WriteWithNinjaVariables(pattern, options, out_); | 125 SubstitutionWriter::WriteWithNinjaVariables(pattern, options, out_); |
132 out_ << std::endl; | 126 out_ << std::endl; |
133 } | 127 } |
OLD | NEW |