Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(86)

Side by Side Diff: tools/gn/xcode_writer.cc

Issue 2152413002: GN: don't write separate files for non-binary targets (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tools/gn/xcode_writer.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
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 }
OLDNEW
« no previous file with comments | « tools/gn/xcode_writer.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698