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

Unified Diff: tools/gn/ninja_writer.cc

Issue 22290010: Add support for data deps. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove switch Created 7 years, 4 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
« no previous file with comments | « tools/gn/ninja_writer.h ('k') | tools/gn/scope_per_file_provider.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/ninja_writer.cc
diff --git a/tools/gn/ninja_writer.cc b/tools/gn/ninja_writer.cc
index 8b69a3fc73536a7eaaf258b6d5a1220652bcc9d6..9eec8654cf80bd49647fcf5418f7918ad8a6559b 100644
--- a/tools/gn/ninja_writer.cc
+++ b/tools/gn/ninja_writer.cc
@@ -29,6 +29,12 @@ bool NinjaWriter::WriteRootBuildfiles() {
std::vector<const Target*> all_targets;
build_settings_->target_manager().GetAllTargets(&all_targets);
+ if (all_targets.empty()) {
+ Err(Location(), "No targets.",
+ "I could not find any targets to write, so I'm doing nothing.")
+ .PrintToStdout();
+ return false;
+ }
for (size_t i = 0; i < all_targets.size(); i++) {
categorized[all_targets[i]->label().GetToolchainLabel()].push_back(
all_targets[i]);
@@ -54,11 +60,19 @@ bool NinjaWriter::WriteRootBuildfiles() {
if (i->first == default_label)
default_targets = &i->second;
all_settings.push_back(settings);
- if (!NinjaToolchainWriter::RunAndWriteFile(settings, i->second))
+ if (!NinjaToolchainWriter::RunAndWriteFile(settings, i->second)) {
+ Err(Location(),
+ "Couldn't open toolchain buildfile(s) for writing").PrintToStdout();
return false;
+ }
}
// Write the root buildfile.
- return NinjaBuildWriter::RunAndWriteFile(build_settings_, all_settings,
- *default_targets);
+ if (!NinjaBuildWriter::RunAndWriteFile(build_settings_, all_settings,
+ *default_targets)) {
+ Err(Location(),
+ "Couldn't open toolchain buildfile(s) for writing").PrintToStdout();
+ return false;
+ }
+ return true;
}
« no previous file with comments | « tools/gn/ninja_writer.h ('k') | tools/gn/scope_per_file_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698