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

Unified Diff: tools/gn/substitution_writer.cc

Issue 630223002: gn: Support build directories outside the source tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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
Index: tools/gn/substitution_writer.cc
diff --git a/tools/gn/substitution_writer.cc b/tools/gn/substitution_writer.cc
index 65a1d1fe2859f23388922df978ddb2cab1a71d48..aab01f80d1b0a8b713e7bf550cd8dc0090cc7c68 100644
--- a/tools/gn/substitution_writer.cc
+++ b/tools/gn/substitution_writer.cc
@@ -235,10 +235,6 @@ OutputFile SubstitutionWriter::ApplyPatternToSourceAsOutputFile(
const SubstitutionPattern& pattern,
const SourceFile& source) {
SourceFile result_as_source = ApplyPatternToSource(settings, pattern, source);
- CHECK(result_as_source.is_source_absolute())
- << "The result of the pattern \""
- << pattern.AsString()
- << "\" was not an absolute path beginning in \"//\".";
return OutputFile(settings->build_settings(), result_as_source);
}
@@ -358,7 +354,8 @@ std::string SubstitutionWriter::GetSourceSubstitution(
if (source.is_system_absolute())
return DirectoryWithNoLastSlash(source.GetDir());
return RebaseSourceAbsolutePath(
- DirectoryWithNoLastSlash(source.GetDir()), SourceDir("//"));
+ DirectoryWithNoLastSlash(source.GetDir()), SourceDir("//"),
+ settings->build_settings()->root_path());
case SUBSTITUTION_SOURCE_GEN_DIR:
to_rebase = DirectoryWithNoLastSlash(
@@ -382,7 +379,8 @@ std::string SubstitutionWriter::GetSourceSubstitution(
// extension extraction) will have been handled via early return above.
if (output_style == OUTPUT_ABSOLUTE)
return to_rebase;
- return RebaseSourceAbsolutePath(to_rebase, relative_to);
+ return RebaseSourceAbsolutePath(to_rebase, relative_to,
+ settings->build_settings()->root_path());
}
// static

Powered by Google App Engine
This is Rietveld 408576698