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

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

Issue 1827103005: [GN] Add support for generating Xcode projects. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Improve comment about "assert(product_type != "")" Created 4 years, 7 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/variables.cc ('k') | tools/gn/xcode_object.h » ('j') | 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/visual_studio_writer.h" 5 #include "tools/gn/visual_studio_writer.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
11 #include <set> 11 #include <set>
12 #include <string> 12 #include <string>
13 13
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/strings/string_split.h"
16 #include "base/strings/string_util.h" 15 #include "base/strings/string_util.h"
17 #include "base/strings/utf_string_conversions.h" 16 #include "base/strings/utf_string_conversions.h"
18 #include "tools/gn/builder.h" 17 #include "tools/gn/builder.h"
19 #include "tools/gn/commands.h" 18 #include "tools/gn/commands.h"
20 #include "tools/gn/config.h" 19 #include "tools/gn/config.h"
21 #include "tools/gn/config_values_extractors.h" 20 #include "tools/gn/config_values_extractors.h"
22 #include "tools/gn/filesystem_utils.h" 21 #include "tools/gn/filesystem_utils.h"
23 #include "tools/gn/label_pattern.h" 22 #include "tools/gn/label_pattern.h"
24 #include "tools/gn/parse_tree.h" 23 #include "tools/gn/parse_tree.h"
25 #include "tools/gn/path_output.h" 24 #include "tools/gn/path_output.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 bool VisualStudioWriter::RunAndWriteFiles(const BuildSettings* build_settings, 229 bool VisualStudioWriter::RunAndWriteFiles(const BuildSettings* build_settings,
231 Builder* builder, 230 Builder* builder,
232 Version version, 231 Version version,
233 const std::string& sln_name, 232 const std::string& sln_name,
234 const std::string& dir_filters, 233 const std::string& dir_filters,
235 Err* err) { 234 Err* err) {
236 std::vector<const Target*> targets; 235 std::vector<const Target*> targets;
237 if (dir_filters.empty()) { 236 if (dir_filters.empty()) {
238 targets = builder->GetAllResolvedTargets(); 237 targets = builder->GetAllResolvedTargets();
239 } else { 238 } else {
240 std::vector<std::string> tokens = base::SplitString(
241 dir_filters, ";", base::TRIM_WHITESPACE, base::SPLIT_WANT_NONEMPTY);
242 SourceDir root_dir =
243 SourceDirForCurrentDirectory(build_settings->root_path());
244
245 std::vector<LabelPattern> filters; 239 std::vector<LabelPattern> filters;
246 for (const std::string& token : tokens) { 240 if (!commands::FilterPatternsFromString(build_settings, dir_filters,
247 LabelPattern pattern = 241 &filters, err)) {
248 LabelPattern::GetPattern(root_dir, Value(nullptr, token), err); 242 return false;
249 if (err->has_error())
250 return false;
251 filters.push_back(pattern);
252 } 243 }
253 244
254 commands::FilterTargetsByPatterns(builder->GetAllResolvedTargets(), filters, 245 commands::FilterTargetsByPatterns(builder->GetAllResolvedTargets(), filters,
255 &targets); 246 &targets);
256 } 247 }
257 248
258 const char* config_platform = "Win32"; 249 const char* config_platform = "Win32";
259 250
260 // Assume the "target_cpu" variable does not change between different 251 // Assume the "target_cpu" variable does not change between different
261 // toolchains. 252 // toolchains.
(...skipping 547 matching lines...) Expand 10 before | Expand all | Expand 10 after
809 } 800 }
810 } 801 }
811 802
812 std::string VisualStudioWriter::GetNinjaTarget(const Target* target) { 803 std::string VisualStudioWriter::GetNinjaTarget(const Target* target) {
813 std::ostringstream ninja_target_out; 804 std::ostringstream ninja_target_out;
814 DCHECK(!target->dependency_output_file().value().empty()); 805 DCHECK(!target->dependency_output_file().value().empty());
815 ninja_path_output_.WriteFile(ninja_target_out, 806 ninja_path_output_.WriteFile(ninja_target_out,
816 target->dependency_output_file()); 807 target->dependency_output_file());
817 return ninja_target_out.str(); 808 return ninja_target_out.str();
818 } 809 }
OLDNEW
« no previous file with comments | « tools/gn/variables.cc ('k') | tools/gn/xcode_object.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698