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/xcode_writer.h" | 5 #include "tools/gn/xcode_writer.h" |
6 | 6 |
7 #include <iomanip> | 7 #include <iomanip> |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <sstream> | 10 #include <sstream> |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 } | 138 } |
139 | 139 |
140 } // namespace | 140 } // namespace |
141 | 141 |
142 // static | 142 // static |
143 bool XcodeWriter::RunAndWriteFiles(const std::string& workspace_name, | 143 bool XcodeWriter::RunAndWriteFiles(const std::string& workspace_name, |
144 const std::string& root_target_name, | 144 const std::string& root_target_name, |
145 const std::string& ninja_extra_args, | 145 const std::string& ninja_extra_args, |
146 const std::string& dir_filters_string, | 146 const std::string& dir_filters_string, |
147 const BuildSettings* build_settings, | 147 const BuildSettings* build_settings, |
148 Builder* builder, | 148 const Builder& builder, |
149 Err* err) { | 149 Err* err) { |
150 const XcodeWriter::TargetOsType target_os = | 150 const XcodeWriter::TargetOsType target_os = |
151 GetTargetOs(build_settings->build_args()); | 151 GetTargetOs(build_settings->build_args()); |
152 | 152 |
153 PBXAttributes attributes; | 153 PBXAttributes attributes; |
154 switch (target_os) { | 154 switch (target_os) { |
155 case XcodeWriter::WRITER_TARGET_OS_IOS: | 155 case XcodeWriter::WRITER_TARGET_OS_IOS: |
156 attributes["SDKROOT"] = "iphoneos"; | 156 attributes["SDKROOT"] = "iphoneos"; |
157 attributes["TARGETED_DEVICE_FAMILY"] = "1,2"; | 157 attributes["TARGETED_DEVICE_FAMILY"] = "1,2"; |
158 break; | 158 break; |
(...skipping 14 matching lines...) Expand all Loading... |
173 .StripTrailingSeparators() | 173 .StripTrailingSeparators() |
174 .BaseName() | 174 .BaseName() |
175 .AsUTF8Unsafe(); | 175 .AsUTF8Unsafe(); |
176 DCHECK(!config_name.empty()); | 176 DCHECK(!config_name.empty()); |
177 | 177 |
178 std::string::size_type separator = config_name.find('-'); | 178 std::string::size_type separator = config_name.find('-'); |
179 if (separator != std::string::npos) | 179 if (separator != std::string::npos) |
180 config_name = config_name.substr(0, separator); | 180 config_name = config_name.substr(0, separator); |
181 | 181 |
182 std::vector<const Target*> targets; | 182 std::vector<const Target*> targets; |
183 std::vector<const Target*> all_targets = builder->GetAllResolvedTargets(); | 183 std::vector<const Target*> all_targets = builder.GetAllResolvedTargets(); |
184 if (!XcodeWriter::FilterTargets(build_settings, all_targets, | 184 if (!XcodeWriter::FilterTargets(build_settings, all_targets, |
185 dir_filters_string, &targets, err)) { | 185 dir_filters_string, &targets, err)) { |
186 return false; | 186 return false; |
187 } | 187 } |
188 | 188 |
189 XcodeWriter workspace(workspace_name); | 189 XcodeWriter workspace(workspace_name); |
190 workspace.CreateProductsProject(targets, attributes, source_path, config_name, | 190 workspace.CreateProductsProject(targets, attributes, source_path, config_name, |
191 root_target_name, ninja_extra_args, | 191 root_target_name, ninja_extra_args, |
192 build_settings, target_os); | 192 build_settings, target_os); |
193 | 193 |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
422 for (auto* object : pair.second) { | 422 for (auto* object : pair.second) { |
423 object->Print(out, 2); | 423 object->Print(out, 2); |
424 } | 424 } |
425 out << "/* End " << ToString(pair.first) << " section */\n"; | 425 out << "/* End " << ToString(pair.first) << " section */\n"; |
426 } | 426 } |
427 | 427 |
428 out << "\t};\n" | 428 out << "\t};\n" |
429 << "\trootObject = " << project->Reference() << ";\n" | 429 << "\trootObject = " << project->Reference() << ";\n" |
430 << "}\n"; | 430 << "}\n"; |
431 } | 431 } |
OLD | NEW |