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 |