diff options
author | Evan Martin <martine@danga.com> | 2010-12-13 20:16:55 (GMT) |
---|---|---|
committer | Evan Martin <martine@danga.com> | 2010-12-13 20:16:55 (GMT) |
commit | bad6337f7cd39c557c392b19f8ac89e8ce190e2a (patch) | |
tree | f7fe75d1e15f2f6aecf586f4ad2b06598a8b4654 /src/ninja.cc | |
parent | 07171dd9d7aaa28580827b40203364862c2c0968 (diff) | |
download | Ninja-bad6337f7cd39c557c392b19f8ac89e8ce190e2a.zip Ninja-bad6337f7cd39c557c392b19f8ac89e8ce190e2a.tar.gz Ninja-bad6337f7cd39c557c392b19f8ac89e8ce190e2a.tar.bz2 |
use separate config object
Diffstat (limited to 'src/ninja.cc')
-rw-r--r-- | src/ninja.cc | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/ninja.cc b/src/ninja.cc index 0b2af68..3c09bcd 100644 --- a/src/ninja.cc +++ b/src/ninja.cc @@ -32,10 +32,11 @@ struct RealFileReader : public ManifestParser::FileReader { }; int main(int argc, char** argv) { + BuildConfig config; const char* input_file = "build.ninja"; + bool graph = false; int opt; - bool dry_run = false, graph = false, verbose = false; while ((opt = getopt_long(argc, argv, "ghi:nv", options, NULL)) != -1) { switch (opt) { case 'g': @@ -45,10 +46,10 @@ int main(int argc, char** argv) { input_file = optarg; break; case 'n': - dry_run = true; + config.dry_run = true; break; case 'v': - verbose = true; + config.verbose = true; break; case 'h': default: @@ -89,9 +90,7 @@ int main(int argc, char** argv) { return 0; } - Builder builder(&state); - builder.SetVerbose(verbose); - builder.SetDryRun(dry_run); + Builder builder(&state, config); for (int i = 0; i < argc; ++i) { if (!builder.AddTarget(argv[i], &err)) { if (!err.empty()) { |