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

Unified Diff: tools/gn/xcode_writer.cc

Issue 2740123003: Include "public" source files in generated Xcode project. (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/xcode_writer.cc
diff --git a/tools/gn/xcode_writer.cc b/tools/gn/xcode_writer.cc
index 41af6289bd6010491acc7be3cdb330798b6c0f3e..8b96db49cbbfd25874e7d8e26d53744cdc9c6268 100644
--- a/tools/gn/xcode_writer.cc
+++ b/tools/gn/xcode_writer.cc
@@ -404,7 +404,7 @@ void XcodeWriter::CreateProductsProject(
new PBXProject("products", config_name, source_path, attributes));
SourceDir source_dir("//");
- // Add all source files for indexing.
+ // Add all source files for indexing, both private and public.
std::vector<SourceFile> sources;
for (const Target* target : all_targets) {
for (const SourceFile& source : target->sources()) {
@@ -413,6 +413,16 @@ void XcodeWriter::CreateProductsProject(
sources.push_back(source);
}
+
+ if (target->all_headers_public())
+ continue;
+
+ for (const SourceFile& source : target->public_headers()) {
+ if (IsStringInOutputDir(build_settings->build_dir(), source.value()))
+ continue;
+
+ sources.push_back(source);
+ }
}
// Sort sources to ensure determinisn of the project file generation and
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698