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 9cfbdfb4fe0a553aacc9d63327a8f8aefcc72267..c5a7ad16b5a7581e18d4cbc43baf7a47784c4936 100644 |
--- a/tools/gn/ninja_binary_target_writer.cc |
+++ b/tools/gn/ninja_binary_target_writer.cc |
@@ -125,7 +125,16 @@ void NinjaBinaryTargetWriter::WriteCompilerVars() { |
#undef WRITE_FLAGS |
+ // Write some variables about the target for the toolchain definition to use. |
+ out_ << "target_name = " << target_->label().name() << std::endl; |
+ out_ << "target_out_dir = "; |
+ path_output_.WriteDir(out_, helper_.GetTargetOutputDir(target_), |
+ PathOutput::DIR_NO_LAST_SLASH); |
out_ << std::endl; |
+ out_ << "root_out_dir = "; |
+ path_output_.WriteDir(out_, target_->settings()->toolchain_output_subdir(), |
+ PathOutput::DIR_NO_LAST_SLASH); |
+ out_ << std::endl << std::endl; |
} |
void NinjaBinaryTargetWriter::WriteSources( |