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 335 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 // Sort sources to ensure determinisn of the project file generation and | 346 // Sort sources to ensure determinisn of the project file generation and |
347 // remove duplicate reference to the source files (can happen due to the | 347 // remove duplicate reference to the source files (can happen due to the |
348 // bundle_data targets). | 348 // bundle_data targets). |
349 std::sort(sources.begin(), sources.end()); | 349 std::sort(sources.begin(), sources.end()); |
350 sources.erase(std::unique(sources.begin(), sources.end()), sources.end()); | 350 sources.erase(std::unique(sources.begin(), sources.end()), sources.end()); |
351 | 351 |
352 SourceDir source_dir("//"); | 352 SourceDir source_dir("//"); |
353 for (const SourceFile& source : sources) { | 353 for (const SourceFile& source : sources) { |
354 std::string source_file = | 354 std::string source_file = |
355 RebasePath(source.value(), source_dir, absolute_source_path); | 355 RebasePath(source.value(), source_dir, absolute_source_path); |
356 sources_for_indexing->AddSourceFileToIndexingTarget(source_file, | 356 sources_for_indexing->AddSourceFileToIndexingTarget( |
357 source_file); | 357 source_file, source_file, CompilerFlags::NONE); |
358 } | 358 } |
359 | 359 |
360 projects_.push_back(std::move(sources_for_indexing)); | 360 projects_.push_back(std::move(sources_for_indexing)); |
361 } | 361 } |
362 | 362 |
363 bool XcodeWriter::WriteFiles(const BuildSettings* build_settings, Err* err) { | 363 bool XcodeWriter::WriteFiles(const BuildSettings* build_settings, Err* err) { |
364 for (const auto& project : projects_) { | 364 for (const auto& project : projects_) { |
365 if (!WriteProjectFile(build_settings, project.get(), err)) | 365 if (!WriteProjectFile(build_settings, project.get(), err)) |
366 return false; | 366 return false; |
367 } | 367 } |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
428 for (auto* object : pair.second) { | 428 for (auto* object : pair.second) { |
429 object->Print(out, 2); | 429 object->Print(out, 2); |
430 } | 430 } |
431 out << "/* End " << ToString(pair.first) << " section */\n"; | 431 out << "/* End " << ToString(pair.first) << " section */\n"; |
432 } | 432 } |
433 | 433 |
434 out << "\t};\n" | 434 out << "\t};\n" |
435 << "\trootObject = " << project->Reference() << ";\n" | 435 << "\trootObject = " << project->Reference() << ";\n" |
436 << "}\n"; | 436 << "}\n"; |
437 } | 437 } |
OLD | NEW |