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

Unified Diff: tools/gn/xcode_writer.cc

Issue 2489673004: gn: Include source files outside the source root for Xcode workspace (Closed)
Patch Set: Created 4 years, 1 month 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 | « tools/gn/xcode_writer.h ('k') | 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 e6b66d5b58b43adc61a93935e4f5ffbacb006652..bce396b56a9bebffea7c8f85a43251d36118208d 100644
--- a/tools/gn/xcode_writer.cc
+++ b/tools/gn/xcode_writer.cc
@@ -191,9 +191,9 @@ bool XcodeWriter::RunAndWriteFiles(const std::string& workspace_name,
root_target_name, ninja_extra_args,
build_settings, target_os);
- workspace.CreateSourcesProject(all_targets, build_settings->build_dir(),
- attributes, source_path, config_name,
- target_os);
+ workspace.CreateSourcesProject(
+ all_targets, build_settings->build_dir(), attributes, source_path,
+ build_settings->root_path_utf8(), config_name, target_os);
return workspace.WriteFiles(build_settings, err);
}
@@ -321,14 +321,12 @@ void XcodeWriter::CreateSourcesProject(
const SourceDir& root_build_dir,
const PBXAttributes& attributes,
const std::string& source_path,
+ const std::string& absolute_source_path,
const std::string& config_name,
TargetOsType target_os) {
std::vector<SourceFile> sources;
for (const Target* target : targets) {
for (const SourceFile& source : target->sources()) {
- if (source.is_system_absolute())
- continue;
-
if (IsStringInOutputDir(root_build_dir, source.value()))
continue;
@@ -347,7 +345,8 @@ void XcodeWriter::CreateSourcesProject(
SourceDir source_dir("//");
for (const SourceFile& source : sources) {
- std::string source_file = RebasePath(source.value(), source_dir);
+ std::string source_file =
+ RebasePath(source.value(), source_dir, absolute_source_path);
sources_for_indexing->AddSourceFile(source_file);
}
« 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