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

Unified Diff: tools/gn/setup.h

Issue 558763002: Require build directories exist for some GN commands. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: file path literal Created 6 years, 3 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/command_refs.cc ('k') | tools/gn/setup.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/gn/setup.h
diff --git a/tools/gn/setup.h b/tools/gn/setup.h
index 0cd0a7930a1cf6a1ab9b2e93b4041ec0e1aa8dc6..558c54d3c4861edbf6608ffaa1b713fb9d97fac5 100644
--- a/tools/gn/setup.h
+++ b/tools/gn/setup.h
@@ -98,7 +98,14 @@ class Setup : public CommonSetup {
// The parameter is the string the user specified for the build directory. We
// will try to interpret this as a SourceDir if possible, and will fail if is
// is malformed.
- bool DoSetup(const std::string& build_dir);
+ //
+ // With force_create = false, setup will fail if the build directory doesn't
+ // alreay exist with an args file in it. With force_create set to true, the
+ // directory will be created if necessary. Commands explicitly doing
+ // generation should set this to true to create it, but querying commands
+ // should set it to false to prevent creating oddly-named directories in case
+ // the user omits the build directory argument (which is easy to do).
+ bool DoSetup(const std::string& build_dir, bool force_create);
// Runs the load, returning true on success. On failure, prints the error
// and returns false. This includes both RunPreMessageLoop() and
@@ -139,8 +146,8 @@ class Setup : public CommonSetup {
// Fills the build directory given the value the user has specified.
// Must happen after FillSourceDir so we can resolve source-relative
- // paths.
- bool FillBuildDir(const std::string& build_dir);
+ // paths. If require_exists is false, it will fail if the dir doesn't exist.
+ bool FillBuildDir(const std::string& build_dir, bool require_exists);
// Fills the python path portion of the command line. On failure, sets
// it to just "python".
« no previous file with comments | « tools/gn/command_refs.cc ('k') | tools/gn/setup.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698