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

Unified Diff: tools/gn/ninja_build_writer.cc

Issue 2389133003: GN: use the correct directory for self-invocation. (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/ninja_build_writer.cc
diff --git a/tools/gn/ninja_build_writer.cc b/tools/gn/ninja_build_writer.cc
index fba1ccb5a0b21a0ec323317b151b75b1e5084dcf..a0dd8ce41036e3dc7303c519b76d944fb1b61da3 100644
--- a/tools/gn/ninja_build_writer.cc
+++ b/tools/gn/ninja_build_writer.cc
@@ -52,8 +52,13 @@ std::string GetSelfInvocationCommand(const BuildSettings* build_settings) {
PathService::Get(base::FILE_EXE, &executable);
base::CommandLine cmdline(executable.NormalizePathSeparatorsTo('/'));
+
+ // Use "." for the directory to generate. When Ninja runs the command it
+ // will have the build directory as the current one. Coding it explicitly
+ // will cause everything to get confused if the user renames the directory.
cmdline.AppendArg("gen");
- cmdline.AppendArg(build_settings->build_dir().value());
+ cmdline.AppendArg(".");
+
cmdline.AppendSwitchPath(std::string("--") + switches::kRoot,
build_settings->root_path());
// Successful automatic invocations shouldn't print output.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698