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

Unified Diff: tools/gn/ninja_binary_target_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: Updated 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/ninja_binary_target_writer.cc
diff --git a/tools/gn/ninja_binary_target_writer.cc b/tools/gn/ninja_binary_target_writer.cc
index b341639b5d433964712093f72b0a519f0c14e290..27defbc7b87a16a16b01a390a187244f47ca4260 100644
--- a/tools/gn/ninja_binary_target_writer.cc
+++ b/tools/gn/ninja_binary_target_writer.cc
@@ -103,6 +103,7 @@ void NinjaBinaryTargetWriter::WriteCompilerVars() {
if (subst.used[SUBSTITUTION_INCLUDE_DIRS]) {
out_ << kSubstitutionNinjaNames[SUBSTITUTION_INCLUDE_DIRS] << " =";
PathOutput include_path_output(path_output_.current_dir(),
+ settings_->build_settings()->root_path(),
ESCAPE_NINJA_COMMAND);
RecursiveTargetConfigToStream<SourceDir>(
target_, &ConfigValues::include_dirs,
@@ -150,6 +151,7 @@ void NinjaBinaryTargetWriter::WriteSources(
if (tool_type != Toolchain::TYPE_NONE) {
out_ << "build";
path_output_.WriteFiles(out_, tool_outputs);
+
out_ << ": " << rule_prefix << Toolchain::ToolTypeToName(tool_type);
out_ << " ";
path_output_.WriteFile(out_, source);
@@ -288,6 +290,7 @@ void NinjaBinaryTargetWriter::WriteLinkerFlags() {
// Since we're passing these on the command line to the linker and not
// to Ninja, we need to do shell escaping.
PathOutput lib_path_output(path_output_.current_dir(),
+ settings_->build_settings()->root_path(),
ESCAPE_NINJA_COMMAND);
for (size_t i = 0; i < all_lib_dirs.size(); i++) {
out_ << " " << tool_->lib_dir_switch();

Powered by Google App Engine
This is Rietveld 408576698